Most Common Linux Commands for Server Admin (Complete Guide)

Linux powers most of the internet. From web servers to cloud platforms like AWS, almost everything runs on Linux.

If you are managing a server, learning Linux commands is not optional — it is essential.

In this complete guide, you will learn the most common Linux commands used by server administrators, along with real-world usage examples.


Why Linux Commands Are Important

Most production servers do not have a graphical interface. Everything is managed through the terminal.

Knowing Linux commands helps you:

  • Manage servers faster
  • Troubleshoot issues instantly
  • Automate repetitive tasks
  • Improve system performance

Basic Navigation Commands

pwd (Print Working Directory)

Shows your current directory.

Example:

pwd

ls (List Files)

Lists files and directories.

Example:

ls -la

cd (Change Directory)

Move between directories.

Example:

cd /var/www/html

File Management Commands

cp (Copy Files)

cp file.txt backup.txt

mv (Move/Rename Files)

mv old.txt new.txt

rm (Remove Files)

rm file.txt

⚠️ Be careful — deleted files cannot be recovered easily.


mkdir (Create Directory)

mkdir newfolder

File Viewing Commands

cat

View small files.

cat file.txt

less

View large files with scroll.

less file.log

tail

Monitor logs in real-time.

tail -f /var/log/syslog

Permissions & Ownership

chmod

Change file permissions.

chmod 755 script.sh

chown

Change file owner.

chown user:user file.txt

Process Management Commands

ps

List running processes.

ps aux

top

Real-time process monitor.

top

kill

Stop a process.

kill -9 PID

Disk & Storage Commands

df -h

Check disk space.

df -h

du -sh

Check folder size.

du -sh /var/www

Networking Commands

ping

Check connectivity.

ping google.com

netstat / ss

Check open ports.

ss -tulnp

curl

Test HTTP requests.

curl -I https://example.com

Package Management

apt (Ubuntu/Debian)

sudo apt update
sudo apt install nginx

yum (CentOS/RHEL)

yum install httpd

System Information Commands

uname -a

uname -a

uptime

uptime

Advanced Commands

grep

Search text.

grep "error" file.log

find

Find files.

find / -name file.txt

Real-World Server Admin Tasks

Restart Service

systemctl restart nginx

Check Logs

tail -f /var/log/nginx/error.log

Check Port Usage

ss -tulnp

Pro Tips

  • Always double-check commands before running
  • Use sudo carefully
  • Monitor logs regularly
  • Automate repetitive tasks with scripts

FAQs

Which Linux commands are most important?

pwd, ls, cd, cp, mv, rm, top, df, grep

Do I need to memorize all commands?

No, practice regularly and you’ll remember them.


Conclusion

Mastering Linux commands is the foundation of server administration. With practice, you can manage servers efficiently and troubleshoot issues quickly.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *