Basic Linux Commands Every Administrator Must Know

Related Courses

Next Batch : Invalid Date

Basic Linux Commands Every Administrator Must Know - A Practical Guide for Real System Control

Introduction: Why Linux Commands Matter for Administrators

Linux system administrators do not control systems using graphical tools alone. Real administration happens through the command line. Whether managing servers, troubleshooting production issues, monitoring performance, or configuring users and services, Linux commands are the administrator's primary tools.

Knowing the right commands saves time, prevents mistakes, and gives full control over the system. This guide explains essential Linux commands every administrator must know, with practical understanding and real-world relevance.

File and Directory Management Commands

Administrators constantly work with files, logs, configuration folders, and system directories.

pwd - Show Current Directory

Displays the present working directory so you always know where you are in the file system.

Example:
pwd

ls - List Files and Directories

Lists files and directories in the current location.

Common usage:
ls
ls -l
ls -a

  • -l shows detailed info

  • -a shows hidden files

cd - Change Directory

Moves between directories.

Example:
cd /var/log
cd ..
cd ~

mkdir - Create Directory

Creates new directories.

Example:
mkdir backups
mkdir -p /data/archive/2026

rm - Remove Files or Directories

Deletes files or folders.

Example:
rm file.txt
rm -r foldername
rm -rf directory

Use carefully - deletion is permanent.

cp - Copy Files and Directories

Copies files from one location to another.

Example:
cp file.txt backup.txt
cp -r folder1 folder2

mv - Move or Rename Files

Moves or renames files and directories.

Example:
mv file.txt /backup
mv oldname.txt newname.txt

Viewing and Reading Files

Administrators often check logs and configuration files.

cat - Display File Content

Shows entire file content.
cat file.txt

less - View Large Files Safely

Best for viewing large log files without loading fully.
less /var/log/syslog

head - First Lines of File

head file.txt

tail - Last Lines of File

Common for log monitoring.
tail -f /var/log/messages

User and Permission Management

Security and access control are critical admin responsibilities.

whoami - Current User

whoami

id - User and Group Info

id username

chmod - Change Permissions

Controls read, write, execute access.
chmod 755 script.sh
chmod +x file.sh

chown - Change Ownership

chown user:group file.txt

useradd - Create User

useradd username

passwd - Set Password

passwd username

Process Management Commands

Administrators must monitor and control running programs.

ps - View Running Processes

ps aux

top - Real-Time System Monitoring

Shows CPU, memory, processes live.
top

kill - Stop Process

kill PID
kill -9 PID

pkill - Kill by Name

pkill nginx

Disk and Storage Commands

Monitoring disk usage is essential for system stability.

df - Disk Usage

df -h

du - Directory Size

du -sh /var/log

mount - Mount Filesystem

mount /dev/sdb1 /mnt/data

umount - Unmount

umount /mnt/data

Networking Commands

Admins frequently troubleshoot connectivity and server communication.

ip - Network Information

ip addr
ip route

ping - Connectivity Test

ping google.com

netstat - Network Connections

netstat -tulnp

ss - Modern Network Tool

ss -tuln

curl - Test API / Web Request

curl http://example.com

System Monitoring and Performance

uptime - System Running Time

uptime

free - Memory Usage

free -h

vmstat - System Performance

vmstat

iostat - Disk Performance

iostat

Package Management (Software Installation)

Ubuntu / Debian

apt update
apt install nginx

RHEL / CentOS

yum install httpd
dnf install docker

Service Management

systemctl - Control Services

systemctl start nginx
systemctl stop nginx
systemctl restart nginx
systemctl status nginx
systemctl enable nginx

Log Monitoring

Logs help diagnose problems.
tail -f /var/log/syslog
journalctl -xe

Searching and Filtering

grep - Search Inside Files

grep "error" logfile.txt

find - Locate Files

find / -name file.txt

Archiving and Compression

tar - Archive Files

tar -cvf backup.tar folder
tar -xvf backup.tar

gzip / gunzip

gzip file.txt
gunzip file.txt.gz

Why These Commands Matter

A Linux administrator uses these commands daily for:

  • Managing users

  • Monitoring system health

  • Troubleshooting servers

  • Handling permissions

  • Configuring services

  • Managing storage

  • Ensuring security

  • Automating operations

These commands form the foundation of Linux administration.

Frequently Asked Questions (FAQ)

1. Which Linux command is most important?

Commands like ls, cd, top, ps, chmod, systemctl, and df are used daily by administrators.

2. How do administrators monitor system performance?

Using top, vmstat, iostat, and free commands.

3. How do I check disk usage?

Use df -h and du -sh.

4. How do I manage services?

Use systemctl start, stop, restart, and status.

5. How do I check running processes?

Use ps aux or top.

6. How do I change file permissions?

Use chmod command.

7. How do I check logs?

Use tail -f and journalctl.

8. How do I add users?

Use useradd and passwd.

9. How do I test network connectivity?

Use ping and ip addr.

10. Why must administrators know command line?

Because real server management and troubleshooting happen through terminal.

Final Thoughts

Linux commands are the everyday tools of a system administrator. Mastering these commands gives you full control over servers, systems, and infrastructure.

Once you become comfortable with these commands, Linux administration becomes faster, safer, and more powerful.