Introduction:

Linux is at the heart of countless servers, data centers, and embedded systems, making it one of the most prevalent operating systems in the world. If you’re an aspiring or seasoned Linux administrator, you’ll rely on many commands to effectively manage and maintain Linux systems. This comprehensive guide will dive into 190 essential Linux commands that every Linux administrator should know. Whether you’re a beginner looking to build a strong foundation or an experienced admin seeking to expand your skill set, this resource has you covered.

Note: It’s impossible to cover every Linux command in one article, but we’ve curated a diverse list of essential commands that cover various aspects of Linux administration.

Navigation and File Management (20 Commands)

  1. ls : List files and directories.
  2. cd : Change directories.
  3. pwd : Print working directory.
  4. mkdir : Create directories.
  5. rmdir : Remove directories.
  6. touch : Create empty files.
  7. cp : Copy files and directories.
  8. mv : Move or rename files and directories.
  9. rm : Remove files.
  10. find : Search for files and directories.
  11. which : Locate a command.
  12. cat : Concatenate and display file content.
  13. more / less : Paginate file content.
  14. head / tail : Display the beginning or end of a file.
  15. ln : Create symbolic or hard links.
  16. stat : Display file or filesystem status.
  17. du : Estimate file and directory space usage.
  18. df : Report filesystem disk space usage.
  19. tree : Display directory tree structure.
  20. ncdu : A disk usage analyzer with a text-based interface.

User and Group Management (15 Commands)

  1. useradd : Add a user account.
  2. userdel : Delete a user account.
  3. passwd : Change user passwords.
  4. groupadd : Add a group.
  5. groupdel : Delete a group.
  6. usermod : Modify user properties.
  7. groupmod : Modify group properties.
  8. su : Switch user.
  9. sudo : Execute commands as another user.
  10. who : Show who is logged on.
  11. w : Display who is logged in and what they are doing.
  12. id : Display user and group IDs.
  13. chown : Change file and directory ownership.
  14. chgrp : Change file and directory group ownership.
  15. newgrp : Start a new group with another group identity.

System Information and Monitoring (15 Commands)

  1. uname : Display system information.
  2. hostname : Show or set system hostname.
  3. uptime : Display system uptime.
  4. top : Monitor system processes.
  5. htop : Interactive process viewer.
  6. ps : List running processes.
  7. kill : Terminate processes.
  8. free : Display memory usage.
  9. vmstat : Virtual memory statistics.
  10. iostat : Input/output statistics.
  11. netstat : Network statistics.
  12. ifconfig : Configure network interfaces.
  13. lspci : List PCI devices.
  14. lsusb : List USB devices.
  15. lsblk : List block devices.

Package Management (10 Commands)

  1. apt : Advanced Package Tool (Debian/Ubuntu).
  2. dnf : Dandified YUM (Fedora/RHEL).
  3. yum : Yellowdog Updater Modified (RHEL/CentOS).
  4. zypper : OpenSUSE package manager.
  5. rpm : RPM Package Manager (query and verify).
  6. dpkg : Debian package manager.
  7. yumdownloader : Download RPM packages.
  8. dpkg-deb : Manipulate Debian packages.
  9. apt-get : Debian-based package manager.
  10. dnf install : Install packages (Fedora/RHEL).

File Permissions and Ownership (10 Commands)

  1. chmod : Change file permissions.
  2. chown : Change file ownership.
  3. chgrp : Change group ownership.
  4. ls -l : Display detailed file information.
  5. umask : Set default file permissions.
  6. setfacl : Set file access control lists.
  7. getfacl : Get file access control lists.
  8. passwd -l : Lock a user account.
  9. passwd -u : Unlock a user account.
  10. visudo : Edit the sudoers file safely.

Disk Management (10 Commands)

  1. fdisk : Partition table manipulator.
  2. gdisk : GPT fdisk.
  3. parted : Disk partitioning tool.
  4. mkfs : Create filesystems.
  5. mount : Mount filesystems.
  6. umount : Unmount filesystems.
  7. df : Disk space usage.
  8. du : Estimate disk usage.
  9. smartctl : Control and monitor storage systems.
  10. fsck : Filesystem consistency check.

Process Management (10 Commands)

  1. ps : List processes.
  2. top : Dynamic process viewer.
  3. kill : Terminate processes.
  4. htop : Interactive process viewer.
  5. pgrep : List processes by name.
  6. pkill : Signal processes based on name.
  7. nice : Change process priority.
  8. renice : Alter process priority.
  9. at : Schedule tasks.
  10. cron : Schedule recurring tasks.

Networking (15 Commands)

  1. ifconfig : Configure network interfaces.
  2. ip : Advanced IP configuration.
  3. ping : Send ICMP echo requests.
  4. traceroute : Trace network routes.
  5. netstat : Network statistics.
  6. ss : Socket statistics.
  7. telnet : Telnet client.
  8. ssh : Secure shell client.
  9. scp : Securely copy files.
  10. wget : Retrieve files from the web.
  11. curl : Transfer data with URLs.
  12. nslookup : Query DNS records.
  13. host : DNS lookup utility.
  14. dig : DNS information groper.
  15. nc : Network utility (Netcat).

System and Service Management (15 Commands)

  1. systemctl : Systemd control manager.
  2. service : Init script service manager.
  3. chkconfig : Configure system services.
  4. ps aux : List all processes.
  5. journalctl : Query systemd logs.
  6. dmesg : Display kernel ring buffer.
  7. shutdown : Shutdown or restart the system.
  8. reboot : Reboot the system.
  9. hostnamectl : Control system hostname.
  10. timedatectl : Control system time and date.
  11. locale : Set system locale.
  12. lsb_release : Display distribution info.
  13. ufw : Uncomplicated Firewall.
  14. iptables : IP packet filter administration.
  15. sysctl : System control parameters.

File Compression and Archiving (10 Commands)

  1. tar : Archive files.
  2. gzip : Compress files.
  3. gunzip : Decompress files.
  4. bzip2 : Compress files (bzip2).
  5. bunzip2 : Decompress files (bzip2).
  6. zip : Package and compress files (zip).
  7. unzip : Extract files from zip archives.
  8. rar : Create and extract RAR archives.
  9. 7z : Create and extract 7z archives.
  10. xz : Compress files (xz).

Text Processing (10 Commands)

  1. cat : Concatenate and display file content.
  2. grep : Search text using patterns.
  3. sed : Stream editor.
  4. awk : Text processing tool.
  5. cut : Remove sections from lines of files.
  6. sort : Sort lines in text files.
  7. uniq : Remove duplicates from sorted files.
  8. head / tail : Display the beginning or end of a file.
  9. wc : Word, line, character, and byte count.
  10. tee : Redirect output to multiple files.

Disk and Filesystem Monitoring (10 Commands)

  1. iotop : Monitor I/O usage.
  2. iostat : Input/output statistics.
  3. df : Disk space usage.
  4. du : Estimate disk usage.
  5. lsof : List open files.
  6. fuser : Identify processes using files.
  7. watch : Execute commands repeatedly.
  8. inotifywait : Monitor file system events.
  9. sync : Synchronize cached writes to disk.
  10. hdparm : Get/set hard disk parameters.

System Information Gathering (10 Commands)

  1. lscpu : Display CPU information.
  2. lsblk : List block devices.
  3. lshw : List hardware details.
  4. lspci : List PCI devices.
  5. lsusb : List USB devices.
  6. dmidecode : Display hardware information.
  7. uname : Display system information.
  8. free : Display memory usage.
  9. fdisk -l : List disk partitions.
  10. lsmod : List loaded kernel modules.

File Editing (10 Commands)

  1. nano : Text editor for the terminal.
  2. vim : Powerful text editor.
  3. vi : Classic text editor.
  4. ed : Line-oriented text editor.
  5. sed : Stream editor.
  6. awk : Text processing tool.
  7. grep : Search text using patterns.
  8. cut : Remove sections from lines of files.
  9. tr : Translate characters.
  10. echo : Display messages.

Backup and Restore (10 Commands)

  1. tar : Archive files.
  2. rsync : Remote file and directory sync.
  3. dd : Convert and copy files.
  4. cp : Copy files and directories.
  5. mv : Move or rename files and directories.
  6. find : Search for files and directories.
  7. locate : Find files by name.
  8. grep : Search text using patterns.
  9. cron : Schedule recurring tasks.
  10. at : Schedule tasks.

Security (10 Commands)

  1. passwd : Change user passwords.
  2. sudo : Execute commands as another user.
  3. chmod : Change file permissions.
  4. chown : Change file ownership.
  5. chgrp : Change group ownership.
  6. ufw : Uncomplicated Firewall.
  7. iptables : IP packet filter administration.
  8. ssh-keygen : Generate SSH keys.
  9. gpg : GNU Privacy Guard for encryption.
  10. openssl : OpenSSL toolkit for security tasks.

Conclusion:

Becoming a proficient Linux administrator requires mastering a diverse set of commands. The 190 commands presented in this guide are essential for managing Linux systems, from basic file manipulation to advanced network and security tasks. As you gain experience and tackle different challenges, these commands will become invaluable tools in your Linux administration toolbox. Keep exploring, learning, and honing your Linux skills to become a proficient and efficient Linux administrator. Happy Linux administration!