Important Linux commands

All the tools you need as a server admin

It is difficult to compile a definitive list of the most important commands on Linux, as the importance of different commands can vary depending on the specific needs and tasks of the user.

Let's try it anyway! Here is our all-time favorite list of commonly used and important commands on Linux systems, that you should definitely know:

  • bash: widely used Unix shell
  • cat: concatenate and display files
  • cd: change the current directory
  • cp: copy files and directories
  • df: display information about free disk space
  • du: display the size of a file or directory
  • echo: display a message or the value of a variable
  • kill: send a signal to a process
  • less: view the contents of a file one page at a time
  • ls: list the contents of a directory
  • man: display the manual page for a command
  • mc: start the Midnight Commander
  • mkdir: create a new directory
  • mv: move or rename files and directories
  • ping: send a network test packet
  • ps: display information about running processes
  • pwd: print the current working directory
  • rm: delete files and directories
  • rsync: synchronize files between two systems
  • screen: run multiple "tabs" in one terminal session
  • ssh: connect to a remote host using the Secure Shell (SSH) protocol
  • sudo: execute a command as root
  • tail: display the last few lines of a file
  • top: display the top running processes

Here at CleverUptime, we are using all of those commands on a daily basis. They make our life easier and everybody knows them by heart.

If you read this far, you probably know already all the commands above and you're interested to learn about other commands that can help you as an admin.

Great! Here is the extended list:

  • ab: a tool for benchmarking web servers
  • alias: create a shortcut for a command
  • apt: install, remove, and manage software packages
  • apt-cache: search for and display information about software packages
  • apt-get: install, remove, and manage software packages
  • aptitude: a high-level interface for managing packages in Debian-based systems
  • aria2c: download files using different protocols
  • at: execute a command at a specified time
  • atop: show performance metrics
  • awk: perform text processing and data manipulation tasks
  • bg: resume a suspended job in the background
  • blkid: identify and manage filesystem labels and UUIDs
  • btrfs: manage the btrfs file system
  • bunzip2: decompress .bz2 files
  • bzip2: compress files using the Burrows-Wheeler block-sorting compression algorithm
  • cancel: remove jobs from the print queue
  • certbot: manage SSL/TLS certificates from Let's Encrypt
  • chgrp: change the group ownership of a file or directory
  • chkconfig: manage system services across runlevels
  • chmod: change the permissions of a file or directory
  • chown: change the owner of a file or directory
  • comm: compare two sorted files line by line
  • crontab: schedule a command to be executed at a specified time
  • cryptsetup: encrypt block devices
  • csh: launch the C shell, a Unix command interpreter with C-like syntax
  • curl: transfer data to or from a server
  • cut: extract fields or columns from a file
  • date: display the current date and time
  • dd: copy data between block devices
  • dd_rescue: rescue data from block devices
  • dhclient: request and configure network parameters using DHCP
  • diff: compare two files and display the differences
  • dig: query the domain name system
  • dispatch-conf: update configuration files with Gentoo Linux
  • dmesg: view the kernel's message buffer
  • dnf: install, remove, and manage software packages on Fedora-based systems
  • docker: manage software running in containers
  • dosfsck: check and repair FAT file systems
  • dpkg: install, remove, and manage Debian package files
  • dpkg-reconfigure: reconfigure installed packages in Debian-based systems
  • e2fsck: check and repair ext file systems
  • ebuild: manage and install Gentoo packages manually
  • emacs: edit text files with the Emacs editor
  • emerge: install, remove, and manage software packages on Gentoo-based systems
  • equery: query information about installed packages in Gentoo
  • eselect: manage system configurations in Gentoo
  • etc-update: merge updated configuration files in Gentoo
  • exec: replace the current shell process with a specified command
  • export: set the value of an environment variable
  • exportfs: export directories to NFS clients
  • fdisk: manage partitions on hard drives and SSDs
  • fdupes: find and manage duplicate files
  • ffmpeg: manipulate multimedia files
  • fg: bring a background job to the foreground
  • file: determine the type of a file
  • find: search for files and directories
  • flock: manage file locking from shell scripts
  • fold: adjust the width of output
  • free: display information about free and used memory
  • fsck: check and repair a file system
  • fuser: identify processes using files or sockets
  • gcc: compile C files
  • gdb: debug programs written in various languages
  • gdisk: guided partition table manipulation
  • genkernel: automate kernel and initramfs generation in Gentoo
  • getenforce: display SELinux status (enforcing, permissive, or disabled)
  • getent: get information from administrative databases
  • git: a version control system
  • gpasswd: administer /etc/group and manage group passwords
  • grep: search for a pattern of text within a file
  • groupadd: add a group
  • groupdel: delete a group
  • groupmod: modify a group
  • gunzip: decompress files
  • gzip: compress or decompress files
  • halt: shut down the system
  • head: display the first few lines of a file
  • hexdump: display file contents in hexadecimal, decimal, octal, or ASCII
  • host: query DNS servers
  • hostname: display the hostname of the system
  • htop: display performance metrics
  • id: display user and group IDs
  • ifconfig: display information about network interfaces
  • init: change the runlevel
  • iostat: display information about the current I/O performance
  • iotop: display performance metrics for I/O
  • ip: display and configure network interfaces
  • iptables: configure the kernel's firewall
  • jobs: display active jobs in the current shell session
  • join: join lines of two files on a common field
  • journalctl: display logging information
  • jq: process JSON input and produce JSON output
  • killall: terminate processes by name
  • ksh: launch the Korn shell, a Unix command interpreter
  • last: display users who logged in last
  • lastb: show failed login attempts
  • lastlog: display the last login time for each user
  • ldconfig: configure dynamic linker run-time bindings
  • lilo: install and configure the Linux bootloader
  • ln: manage hard and soft links
  • locate: search for files and directories using a database
  • logger: add messages to the system log
  • logrotate: organize log files
  • lp: send files to the printer
  • lpq: check the print queue
  • lpr: send files to the printer
  • lprm: remove jobs from the print queue
  • lpstat: display information about print jobs
  • lsb_release: display information about your Linux distribution
  • lsblk: list block devices
  • lsmod: list loaded kernel modules
  • lsof: list open files
  • lspci: list PCI devices
  • lvcreate: create logical volumes
  • lvdisplay: show logical volumes
  • lvremove: delete logical volumes
  • lynx: browse the Web in a terminal window
  • mailq: manage the mail queue
  • md5sum: calculate the MD5 checksum
  • mdadm: manage RAID devices
  • memtest86: test the RAM
  • mkfs.btrfs: format a device with btrfs
  • mkfs.ext4: format a device with ext4
  • mkfs.ntfs: format a device with NTFS
  • mkfs.vfat: format a device with FAT
  • mkfs.xfs: format a device with XFS
  • mkswap: create swap space
  • modprobe: add or remove kernel modules
  • more: view the contents of a file one page at a time
  • mount: make file systems accessible in the directory tree
  • mutt: manage emails
  • mysqldump: create backups of your MySQL database
  • nano: edit text files with the Nano editor
  • nc: send data over the network
  • netconfig: configure network interfaces
  • netstat: display network statistics
  • nft: configure the kernel's firewall
  • nice: run a command with a modified scheduling priority
  • nmap: scan for open ports and services
  • nohup: run a command immune to hangups, with output to a non-tty.
  • nslookup: query DNS servers
  • ntpq: query NTP servers
  • openssl: manage SSL certificates
  • pacman: install, remove, and manage software packages on Arch Linux-based systems
  • partprobe: re-read the partition table
  • passwd: set user passwords
  • paste: combine lines of files
  • patch: apply a diff file to an original file
  • pdftk: manipulate PDF files
  • pkgtool: the Slackware package manager
  • pmap: report memory usage of a process
  • printenv: display the value of an environment variable
  • ptrace: trace and control system calls of a running process
  • pv: monitor the progress of a pipe
  • pvcreate: create a physical volume
  • pwd: print the current working directory
  • python: run Python scripts
  • qemu-img: manage virtual machine images
  • rclone: the swiss army knife for cloud storage
  • readlink: display information about hard and soft links
  • reboot: restart the system
  • renice: alter the priority of a running process
  • rmdir: delete an empty directory
  • rmmod: remove Kernel modules
  • route: modify the IP routing table
  • rsnapshot: create file system backups
  • run-parts: execute scripts or programs in a directory
  • sar: monitor performance metrics
  • scp: copy files to or from a remote host using the Secure Copy (SCP) protocol
  • sed: perform text manipulation and substitution tasks
  • semanage: manage SELinux policy settings
  • sendmail: send emails
  • sestatus: display current SELinux status and policy
  • setenforce: switch between enforcing and permissive mode in SELinux
  • setsebool: enable or disable SELinux boolean values
  • sftp: transfer files to or from a remote host using the Secure File Transfer Protocol (SFTP)
  • sh: launch the Bourne shell
  • sha1sum: compute and verify SHA-1 hash values
  • sha256sum: compute and verify SHA-256 hash values
  • showmount: display NFS server information
  • shutdown: turn off or reboot the system
  • sleep: do nothing for a specified time
  • smartctl: show health and performance data of disk drives
  • snmpwalk: a tool for network management
  • sort: sort the lines of a file
  • ss: show information about network connections
  • ssh-add: add private key identities to the SSH authentication agent
  • ssh-agent: manage private keys for secure shell connections
  • ssh-copy-id - add SSH keys to a remote server
  • ssh-keygen: generate keys for SSH
  • strace: trace system calls and signals
  • stress: load and stress test your system
  • strings: extract printable strings from files
  • su: become the superuser
  • swapoff: deactivate swap space
  • swapon: activate swap space
  • sysctl: a tool for fine-tuning your system
  • systemctl: manage services
  • tac: display files in reversed order
  • tar: create and extract archive files
  • tcpdump: capture network packages
  • tee: chaining together standard input and output
  • telnet: connect to a remote host using the Telnet protocol
  • timeout: run a command with a time limit
  • tmux: run multiple "tabs" in one terminal session
  • touch: create a new file or update the modification time of an existing file
  • tr: modify standard output
  • traceroute: display the network path to a host
  • visudo: edit the sudoers file safely
  • trap: handle signals and events in shell scripts
  • tune2fs: adjust tunable file system parameters on ext2/ext3/ext4
  • ufw: uncomplicated firewall for managing iptables rules
  • ulimit: set or display user-level resource limits
  • umount: remove file systems from the directory tree
  • uname: display information about the system
  • uniq: remove duplicate lines from a file
  • unset: unset the value of an environment variable
  • unzip: unpack files from a ZIP archive
  • unzstd: unpack files using ZStandard
  • update-alternatives: configure default programs for your system
  • uptime: display the current uptime of the system
  • useradd: add users
  • userdel: delete users
  • usermod: modify users
  • vi: edit text files with the vi editor
  • vim: edit text files with the Vim editor, a highly configurable text editor.
  • virsh: manage and interact with virtual machines through the command line.
  • virt-install: create virtual machines
  • virt-manager: manage virtual machines
  • visudo: safely edit the sudoers file, which defines user privileges.
  • vmstat: display performance statistics
  • watch: run a program in regular intervals
  • wc: count the number of lines, words, and characters in a file
  • wget: download files from the Web
  • whereis: display the location of a command, file, or manual page
  • which: display the path of a command
  • who: display a list of users which are currently logged in
  • xargs: transform text into commands
  • xfs_repair: repair XFS file systems
  • xz: compress or decompress files
  • yast: configure a SUSE based system
  • yum: install, remove, and manage software packages on Red Hat-based systems
  • zip: compress files into a ZIP archive
  • zsh: launch the Z shell, an extended version of the Bourne shell with many features
  • zstd: compress or decompress files
  • zypper: install, remove, and manage software packages on openSUSE-based systems

This is just a small selection of the many commands that are available on Linux systems. There are many other important and useful commands that may be specific to certain applications, programming languages, or tasks, and it is always a good idea to familiarize yourself with the commands that are relevant to your work.

The text above is licensed under CC BY-SA 4.0 CC BY SA