Essential Linux Commands Every Server Admin Should Know

Essential Linux Commands Every Server Admin Should Know
Introduction
Linux is the backbone of modern web servers. Whether you’re running a personal blog or managing a fleet of cloud instances, mastering Linux commands is essential for secure and efficient server administration.
In this guide, Vicservers introduces you to the must-know Linux commands that every server administrator should have in their toolkit. From basic navigation to system monitoring, this tutorial is perfect for beginners and intermediates alike.
1. File and Directory Navigation
Understanding the Linux filesystem is the foundation of all server tasks.
pwd
Print Working Directory
pwd
Shows your current directory.
ls
List Contents
ls # List files
ls -l # Long format
ls -a # Include hidden files
cd
Change Directory
cd /etc # Absolute path
cd .. # Go up one level
cd ~ # Go to home directory
mkdir
& rmdir
Create and Remove Directories
mkdir new_folder
rmdir old_folder
2. File Management
Manipulating files is an everyday task for sysadmins.
touch
Create Empty File
touch test.txt
cp
, mv
, rm
Copy, Move, and Remove Files
cp file.txt /backup/
mv file.txt newname.txt
rm file.txt # Use with caution!
cat
, less
, head
, tail
View File Contents
cat file.txt
less file.txt
head -n 10 file.txt # First 10 lines
tail -f /var/log/syslog # Live log view
3. User and Permission Management
Controlling access is critical for server security.
adduser
/ useradd
Create New User
adduser johndoe
passwd
Change Password
passwd johndoe
usermod
Modify User Account
usermod -aG sudo johndoe # Add to sudoers
chmod
/ chown
Change Permissions and Ownership
chmod 755 script.sh
chown user:group file.txt
4. System Monitoring
These commands help you track performance and spot issues.
top
/ htop
Live Process Monitor
top
For a friendlier interface, install htop
:
sudo apt install htop
htop
df -h
Disk Space Usage
df -h
du -sh
Directory Size Summary
du -sh /var/log
free -h
Memory Usage
free -h
uptime
System Load and Running Time
uptime
5. Network Management
Server connectivity is everything—monitor it with these tools.
ip a
or ifconfig
View Network Interfaces
ip a
ping
Test Connectivity
ping google.com
netstat
or ss
List Network Connections
ss -tuln
traceroute
Trace Packet Path
traceroute google.com
curl
& wget
Download Files or Check Web Status
curl -I https://example.com
wget https://example.com/file.zip
6. Package Management
Installing and updating software is common in server maintenance.
For Debian/Ubuntu (APT):
sudo apt update
sudo apt upgrade
sudo apt install nginx
sudo apt remove apache2
For CentOS/RHEL (YUM or DNF):
sudo yum update
sudo yum install httpd
sudo dnf install nginx
7. Searching and Filtering
Find files or filter logs with precision.
find
Search for Files
find / -name "config.php"
grep
Text Pattern Search
grep "error" /var/log/syslog
Use with pipes:
cat log.txt | grep "404"
locate
Fast File Lookup
sudo updatedb
locate php.ini
8. Log File Management
Monitoring logs helps you detect errors and intrusions.
journalctl
Systemd Log Viewer
journalctl -xe
Common Log Files:
/var/log/syslog
– system messages/var/log/auth.log
– SSH and user activity/var/log/apache2/
– Apache logs/var/log/nginx/
– NGINX logs
tail -f
Watch Logs in Real Time
tail -f /var/log/nginx/error.log
9. Process and Service Management
Start, stop, and inspect services.
systemctl
Manage Services on Systemd Systems
sudo systemctl start nginx
sudo systemctl stop apache2
sudo systemctl restart mysql
sudo systemctl status ssh
ps
& kill
List and Terminate Processes
ps aux | grep nginx
kill 1234 # Kill process by PID
kill -9 1234 # Force kill
10. SSH & Remote Management
Connect and control servers remotely.
ssh
Connect to Remote Server
ssh user@yourserver.com
scp
Secure File Copy
scp file.txt user@host:/path/
Bonus: Time-Saving Shortcuts
Shortcut | Description |
---|---|
!! |
Run last command again |
!n |
Run command number n from history |
Ctrl + R |
Reverse search through command history |
history |
Show command history |
alias |
Create command shortcut |
alias ll='ls -lah'
Safety Tips for Admins
- Never run random commands with
sudo
unless you understand them. - Use
--dry-run
options if available (e.g.,rsync --dry-run
) - Regularly back up config files before editing them.
- Use a non-root user with
sudo
privileges for daily tasks. - Set up a firewall (
ufw
orfirewalld
) and fail2ban for security.
Sample Workflow: Updating Your Server Securely
# Step 1: Connect
ssh user@yourserver.com
# Step 2: Update system
sudo apt update && sudo apt upgrade
# Step 3: Check disk space
df -h
# Step 4: Monitor live logs
tail -f /var/log/syslog
# Step 5: Reboot if needed
sudo reboot
Final Thoughts
Mastering essential Linux commands is key to becoming a confident and competent server administrator. While graphical tools like cPanel and WHM simplify hosting, the command line offers unmatched flexibility and power.
Whether you’re running a single VPS or managing multiple client accounts on a reseller server, these Linux commands will serve you well.
Want to Go Deeper?
Vicservers provides fully managed VPS, dedicated servers, and reseller hosting with root access—perfect for learning and applying Linux skills in real time.
✅ 24/7 support
✅ Free migration
✅ Root access + WHM
✅ Secure, SSD-powered infrastructure
Vicservers – Hosting That Empowers You to Take Full Control.