Skip to main content

600 Essential Linux Commands for Developers and Sysadmins

·1004 words·5 mins
Linux Linux Commands Sysadmin DevOps Server Management
Table of Contents

This guide presents one of the most comprehensive Linux command summaries—covering more than 600 commands widely used in daily system administration, development, and DevOps workflows.

Whether you’re a beginner learning Linux basics or an experienced sysadmin managing production servers, this command reference will help you work faster, troubleshoot issues, and optimize system performance.


1. Basic System Information Commands
#

uname -m       # Show machine hardware architecture
uname -r       # Show current kernel version
dmidecode -q   # Display hardware system components
hdparm -i /dev/hda    # List disk architecture characteristics
hdparm -tT /dev/sda   # Perform read tests on disk
arch           # Show processor architecture
cat /proc/cpuinfo     # Display CPU info
cat /proc/meminfo     # Show memory usage
cat /proc/version     # Show kernel version
cat /proc/net/dev     # Show network adapters and statistics
lspci -tv     # List PCI devices
lsusb -tv     # Show USB devices
date          # Display system date
cal 2025      # Display a calendar for the year
clock -w      # Save system time to BIOS

2. Shutdown and Reboot
#

shutdown -h now       # Shutdown system immediately
init 0                # Shutdown using init
telinit 0             # Another shutdown option
shutdown -r now       # Reboot immediately
reboot                # Reboot system
logout                # Log out current user

3. File and Directory Management
#

cd /home         # Change to /home directory
cd ..            # Move up one directory
pwd              # Show current working directory
ls -l            # List files with details
ls -a            # Show hidden files
mkdir dir1       # Create directory
mkdir -p /tmp/dir1/dir2   # Create nested directories
rm -rf dir1      # Remove directory and contents
cp file1 file2   # Copy file
cp -a dir1 dir2  # Copy entire directory
mv old new       # Move/rename file or directory
ln -s file1 lnk1 # Create symbolic link
touch file1      # Create empty file
file file1       # Show file type

4. File Search #

find / -name file1         # Search by filename
find /home -name "*.bin"   # Search files ending with .bin
find /usr/bin -type f -atime +100  # Files not accessed in 100 days
locate "*.ps"              # Locate files ending with .ps (requires updatedb)
whereis ls                 # Show location of binary, source, and man pages
which ls                   # Show executable path of a command

5. Mount and Unmount Filesystems
#

mount /dev/hda2 /mnt/hda2      # Mount partition
umount /dev/hda2               # Unmount partition
fuser -km /mnt/hda2            # Force unmount busy device
mount -o loop file.iso /mnt/iso   # Mount ISO file
mount /dev/sda1 /mnt/usb       # Mount USB device
mount -t vfat /dev/hda5 /mnt/hda5   # Mount FAT32 filesystem

6. Disk Space Management
#

df -h              # Show mounted partitions with usage
du -sh dir1        # Show directory size
du -sk * | sort -rn    # Sort files/directories by size
ls -lSr | more     # Sort files by size

7. User and Group Management
#

groupadd devs           # Create group
useradd user1           # Create user
passwd user1            # Set user password
usermod -aG devs user1  # Add user to group
userdel -r user1        # Delete user and home directory
chage -E 2025-12-31 user1   # Set account expiration date

8. File Permissions
#

ls -lh               # Show file permissions
chmod 755 file1      # Set owner rwx, group rx, others rx
chmod go-rwx dir1    # Remove group/others permissions
chown user1 file1    # Change file ownership
chgrp group1 file1   # Change file group
find / -perm -u+s    # List files with SUID set

9. File Attributes (chattr, lsattr)
#

chattr +i file1   # Make file immutable
chattr +a file1   # Allow only append mode
lsattr file1      # Show special attributes

10. File Compression and Archiving
#

tar -cvf archive.tar file1 dir1    # Create tar archive
tar -xvf archive.tar              # Extract tar archive
gzip file1                        # Compress with gzip
gunzip file1.gz                   # Decompress gzip
zip -r archive.zip dir1           # Create zip file
unzip archive.zip                 # Extract zip file

11. Package Management (RPM, YUM, DEB, APT)
#

# RPM / YUM (RedHat, CentOS, Fedora)
rpm -ivh package.rpm        # Install rpm package
yum install package         # Install via YUM
yum update                  # Update all packages
yum remove package          # Remove package

# DEB / APT (Debian, Ubuntu)
dpkg -i package.deb         # Install deb package
apt-get install package     # Install via APT
apt-get update              # Update repositories
apt-get upgrade             # Upgrade packages

12. View File Content
#

cat file1          # View file contents
tac file1          # Reverse file contents
more file1         # View file (page by page)
less file1         # Advanced pager
head -n 10 file1   # First 10 lines
tail -n 10 file1   # Last 10 lines
tail -f logfile    # Monitor file in real time

13. Text Processing (grep, sed, awk, sort, uniq)
#

grep "error" logfile          # Search text
sed 's/old/new/g' file1       # Replace text
awk '{print $1,$3}' file1     # Print fields
sort file1 | uniq             # Remove duplicates
wc -l file1                   # Count lines

14. Filesystem and Disk Management
#

fsck /dev/sda1      # Check and repair filesystem
mkfs.ext4 /dev/sda1 # Format partition as ext4
mkswap /dev/sda3    # Create swap space
swapon /dev/sda3    # Enable swap

15. Backup and Restore
#

tar -cvf backup.tar /home       # Create backup
tar -xvf backup.tar             # Restore backup
rsync -av /home /backup         # Sync directories
dd if=/dev/sda of=disk.img      # Disk backup to image
dd if=disk.img of=/dev/sda      # Restore disk from image

16. Networking
#

ifconfig eth0            # Show interface config
ifup eth0                # Bring up interface
ping google.com          # Test connectivity
netstat -tulnp           # Show listening ports
tcpdump port 80          # Capture HTTP traffic
iwlist scan              # Show WiFi networks
nslookup example.com     # DNS lookup
whois example.com        # Whois lookup

17. System Monitoring
#

top                 # Show running processes
htop                # Interactive process viewer
ps aux | grep nginx # Find process
df -h               # Disk usage
free -m             # Memory usage
uptime              # Show load averages

Final Thoughts
#

This Linux command reference is designed to be a quick-access guide for anyone working with servers, development environments, or DevOps automation. By mastering these 600 essential Linux commands, you’ll be able to handle system administration, performance tuning, networking, and security tasks with confidence.

Related

Using the envsubst Command to Replace Environment Variables
·393 words·2 mins
Envsubst Linux Shell Script Environment Variables
How to Monitor Thread Count for Each Microservice in Linux
·502 words·3 mins
Linux CPU Thread Top Microservices Monitoring
Kali Linux – The Swiss Army Knife of Penetration Testing
·516 words·3 mins
Kali Linux Penetration Testing Wireshark Cybersecurity Ethical Hacking