Master Linux Quickly: 100+ Essential Commands Every Sysadmin Needs
This article compiles a comprehensive Linux command reference covering system information, file and directory manipulation, permissions, networking, package management, backup, disk utilities, and editor shortcuts, providing concise examples and options for each command to help administrators work efficiently on the command line.
1. Basic System Information
Quickly retrieve hardware and kernel details using commands such as: uname -m – display processor architecture uname -r – show kernel version dmidecode -q – list DMI/SMBIOS hardware components hdparm -i /dev/hda – show disk characteristics cat /proc/cpuinfo, cat /proc/meminfo, cat /proc/interrupts – view CPU, memory and interrupt info
2. Shutdown and Reboot
Control system power state with: shutdown -h now – immediate halt shutdown -r now – immediate reboot init 0 or telinit 0 – alternative halt commands shutdown -h +hh:mm – schedule a shutdown shutdown -c – cancel a scheduled shutdown reboot – shortcut for reboot logout – end the current session
3. File and Directory Operations
Navigate and manipulate the filesystem: cd /home, cd .., cd - – change directories pwd – print current working directory ls, ls -l, ls -a – list files with details or hidden files mkdir dir1, mkdir -p /tmp/dir1/dir2 – create single or nested directories rm -f file1, rm -rf dir1 – delete files or directories recursively mv old new – rename or move files/directories cp file1 file2, cp -r src/ dest/ – copy files or whole directory trees
4. File Search
Locate files by name, type, age or content: find / -name file1 – search from root find /home/user1 -name "*.bin" – pattern search find /usr/bin -type f -atime +100 – files not accessed in 100 days locate "*.ps" – fast lookup (requires updatedb) grep "pattern" /var/log/messages – search inside files
5. Mounting Filesystems
Attach and detach storage devices and images: mount /dev/hda2 /mnt/hda2 – mount a partition umount /dev/hda2 – unmount mount -o loop file.iso /mnt/iso – mount an ISO image mount -t vfat /dev/hda5 /mnt/hda5 – mount a FAT32 filesystem
mount -t cifs -o username=user,password=pass //server/share /mnt/share– mount a Windows share
6. Disk Space and Filesystem Checks
Assess usage and health of disks: df -h – display mounted partitions with human‑readable sizes du -sh dir1 – estimate space used by a directory badblocks -v /dev/hda1 – scan for bad blocks fsck /dev/hda1, e2fsck /dev/hda1 – check and repair filesystems
7. Users, Groups and Permissions
Manage accounts and access rights: useradd user1, userdel -r user1 – add or remove users groupadd group_name, groupdel group_name – group management usermod -c "Name" -g admin -d /home/user1 -s /bin/bash user1 – modify user attributes chmod ugo+rwx file – set read/write/execute for all chmod g-s /home/public – remove SGID bit chown user:group file – change ownership chattr +i file – make a file immutable
8. Archiving and Compression
Create and extract archives in various formats: tar -cvf archive.tar file1 file2 dir1 – create a tarball tar -xvf archive.tar -C /tmp – extract to a directory tar -czvf archive.tar.gz dir1 – tar + gzip tar -cjf archive.tar.bz2 dir1 – tar + bzip2 zip -r archive.zip dir1 file1 – create zip archive unzip archive.zip – extract zip gzip file, gunzip file.gz – gzip utilities bzip2 file, bunzip2 file.bz2 – bzip2 utilities
9. Package Management (RPM, YUM, DEB/APT)
Install, query, update and remove software packages:
RPM: rpm -ivh package.rpm (install), rpm -e package (erase), rpm -Uvh package.rpm (upgrade), rpm -qa (list installed)
YUM: yum install package, yum update, yum remove package, yum list, yum search term DEB/APT: dpkg -i package.deb, apt-get install package, apt-get update, apt-get upgrade,
apt-cache search term10. Backup and Synchronization
Copy data safely and keep directories in sync: rsync -av --delete /src/ /dest/ – synchronize with deletion dd if=/dev/sda of=/tmp/disk.img bs=1M – raw disk image tar -Puf backup.tar /home/user – incremental tar backup dump -0aj -f /tmp/home0.bak /home – full filesystem dump restore -if /tmp/home0.bak – restore from dump
11. Networking (Ethernet & Wi‑Fi)
Inspect and configure network interfaces: ifconfig eth0 – show interface details ifup eth0, ifdown eth0 – enable/disable dhclient eth0 – obtain address via DHCP route -n – view routing table netstat -tup – list active connections with PIDs tcpdump tcp port 80 – capture HTTP traffic iwlist scan – scan wireless networks
12. Text Processing and Editing (VIM)
Common text‑processing utilities and a brief VIM guide: cat file, more file, less file – view file contents head -n 5 file, tail -f file – preview and follow grep "pattern" file, sed 's/old/new/g' file, awk '{print $1}' file – search and transform
VIM basics: start with vim filename, i to insert, Esc to return to command mode, yy to yank a line, p to paste, :wq to save and quit.
This reference consolidates essential Linux commands for everyday system administration, development, and troubleshooting tasks.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
