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 shellcat
: concatenate and display filescd
: change the current directorycp
: copy files and directoriesdf
: display information about free disk spacedu
: display the size of a file or directoryecho
: display a message or the value of a variablekill
: send a signal to a processless
: view the contents of a file one page at a timels
: list the contents of a directoryman
: display the manual page for a commandmc
: start the Midnight Commandermkdir
: create a new directorymv
: move or rename files and directoriesping
: send a network test packetps
: display information about running processespwd
: print the current working directoryrm
: delete files and directoriesrsync
: synchronize files between two systemsscreen
: run multiple "tabs" in one terminal sessionssh
: connect to a remote host using the Secure Shell (SSH) protocolsudo
: execute a command as roottail
: display the last few lines of a filetop
: 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 serversalias
: create a shortcut for a commandapt
: install, remove, and manage software packagesapt-cache
: search for and display information about software packagesapt-get
: install, remove, and manage software packagesaptitude
: a high-level interface for managing packages in Debian-based systemsaria2c
: download files using different protocolsat
: execute a command at a specified timeatop
: show performance metricsawk
: perform text processing and data manipulation tasksbg
: resume a suspended job in the backgroundblkid
: identify and manage filesystem labels and UUIDsbtrfs
: manage the btrfs file systembunzip2
: decompress.bz2
filesbzip2
: compress files using the Burrows-Wheeler block-sorting compression algorithmcancel
: remove jobs from the print queuecertbot
: manage SSL/TLS certificates from Let's Encryptchgrp
: change the group ownership of a file or directorychkconfig
: manage system services across runlevelschmod
: change the permissions of a file or directorychown
: change the owner of a file or directorycomm
: compare two sorted files line by linecrontab
: schedule a command to be executed at a specified timecryptsetup
: encrypt block devicescsh
: launch the C shell, a Unix command interpreter with C-like syntaxcurl
: transfer data to or from a servercut
: extract fields or columns from a filedate
: display the current date and timedd
: copy data between block devicesdd_rescue
: rescue data from block devicesdhclient
: request and configure network parameters using DHCPdiff
: compare two files and display the differencesdig
: query the domain name systemdispatch-conf
: update configuration files with Gentoo Linuxdmesg
: view the kernel's message bufferdnf
: install, remove, and manage software packages on Fedora-based systemsdocker
: manage software running in containersdosfsck
: check and repair FAT file systemsdpkg
: install, remove, and manage Debian package filesdpkg-reconfigure
: reconfigure installed packages in Debian-based systemse2fsck
: check and repair ext file systemsebuild
: manage and install Gentoo packages manuallyemacs
: edit text files with the Emacs editoremerge
: install, remove, and manage software packages on Gentoo-based systemsequery
: query information about installed packages in Gentooeselect
: manage system configurations in Gentooetc-update
: merge updated configuration files in Gentooexec
: replace the current shell process with a specified commandexport
: set the value of an environment variableexportfs
: export directories to NFS clientsfdisk
: manage partitions on hard drives and SSDsfdupes
: find and manage duplicate filesffmpeg
: manipulate multimedia filesfg
: bring a background job to the foregroundfile
: determine the type of a filefind
: search for files and directoriesflock
: manage file locking from shell scriptsfold
: adjust the width of outputfree
: display information about free and used memoryfsck
: check and repair a file systemfuser
: identify processes using files or socketsgcc
: compile C filesgdb
: debug programs written in various languagesgdisk
: guided partition table manipulationgenkernel
: automate kernel and initramfs generation in Gentoogetenforce
: display SELinux status (enforcing, permissive, or disabled)getent
: get information from administrative databasesgit
: a version control systemgpasswd
: administer /etc/group and manage group passwordsgrep
: search for a pattern of text within a filegroupadd
: add a groupgroupdel
: delete a groupgroupmod
: modify a groupgunzip
: decompress filesgzip
: compress or decompress fileshalt
: shut down the systemhead
: display the first few lines of a filehexdump
: display file contents in hexadecimal, decimal, octal, or ASCIIhost
: query DNS servershostname
: display the hostname of the systemhtop
: display performance metricsid
: display user and group IDsifconfig
: display information about network interfacesinit
: change the runleveliostat
: display information about the current I/O performanceiotop
: display performance metrics for I/Oip
: display and configure network interfacesiptables
: configure the kernel's firewalljobs
: display active jobs in the current shell sessionjoin
: join lines of two files on a common fieldjournalctl
: display logging informationjq
: process JSON input and produce JSON outputkillall
: terminate processes by nameksh
: launch the Korn shell, a Unix command interpreterlast
: display users who logged in lastlastb
: show failed login attemptslastlog
: display the last login time for each userldconfig
: configure dynamic linker run-time bindingslilo
: install and configure the Linux bootloaderln
: manage hard and soft linkslocate
: search for files and directories using a databaselogger
: add messages to the system loglogrotate
: organize log fileslp
: send files to the printerlpq
: check the print queuelpr
: send files to the printerlprm
: remove jobs from the print queuelpstat
: display information about print jobslsb_release
: display information about your Linux distributionlsblk
: list block deviceslsmod
: list loaded kernel moduleslsof
: list open fileslspci
: list PCI deviceslvcreate
: create logical volumeslvdisplay
: show logical volumeslvremove
: delete logical volumeslynx
: browse the Web in a terminal windowmailq
: manage the mail queuemd5sum
: calculate the MD5 checksummdadm
: manage RAID devicesmemtest86
: test the RAMmkfs.btrfs
: format a device with btrfsmkfs.ext4
: format a device with ext4mkfs.ntfs
: format a device with NTFSmkfs.vfat
: format a device with FATmkfs.xfs
: format a device with XFSmkswap
: create swap spacemodprobe
: add or remove kernel modulesmore
: view the contents of a file one page at a timemount
: make file systems accessible in the directory treemutt
: manage emailsmysqldump
: create backups of your MySQL databasenano
: edit text files with the Nano editornc
: send data over the networknetconfig
: configure network interfacesnetstat
: display network statisticsnft
: configure the kernel's firewallnice
: run a command with a modified scheduling prioritynmap
: scan for open ports and servicesnohup
: run a command immune to hangups, with output to a non-tty.nslookup
: query DNS serversntpq
: query NTP serversopenssl
: manage SSL certificatespacman
: install, remove, and manage software packages on Arch Linux-based systemspartprobe
: re-read the partition tablepasswd
: set user passwordspaste
: combine lines of filespatch
: apply a diff file to an original filepdftk
: manipulate PDF filespkgtool
: the Slackware package managerpmap
: report memory usage of a processprintenv
: display the value of an environment variableptrace
: trace and control system calls of a running processpv
: monitor the progress of a pipepvcreate
: create a physical volumepwd
: print the current working directorypython
: run Python scriptsqemu-img
: manage virtual machine imagesrclone
: the swiss army knife for cloud storagereadlink
: display information about hard and soft linksreboot
: restart the systemrenice
: alter the priority of a running processrmdir
: delete an empty directoryrmmod
: remove Kernel modulesroute
: modify the IP routing tablersnapshot
: create file system backupsrun-parts
: execute scripts or programs in a directorysar
: monitor performance metricsscp
: copy files to or from a remote host using the Secure Copy (SCP) protocolsed
: perform text manipulation and substitution taskssemanage
: manage SELinux policy settingssendmail
: send emailssestatus
: display current SELinux status and policysetenforce
: switch between enforcing and permissive mode in SELinuxsetsebool
: enable or disable SELinux boolean valuessftp
: transfer files to or from a remote host using the Secure File Transfer Protocol (SFTP)sh
: launch the Bourne shellsha1sum
: compute and verify SHA-1 hash valuessha256sum
: compute and verify SHA-256 hash valuesshowmount
: display NFS server informationshutdown
: turn off or reboot the systemsleep
: do nothing for a specified timesmartctl
: show health and performance data of disk drivessnmpwalk
: a tool for network managementsort
: sort the lines of a filess
: show information about network connectionsssh-add
: add private key identities to the SSH authentication agentssh-agent
: manage private keys for secure shell connectionsssh-copy-id
- add SSH keys to a remote serverssh-keygen
: generate keys for SSHstrace
: trace system calls and signalsstress
: load and stress test your systemstrings
: extract printable strings from filessu
: become the superuserswapoff
: deactivate swap spaceswapon
: activate swap spacesysctl
: a tool for fine-tuning your systemsystemctl
: manage servicestac
: display files in reversed ordertar
: create and extract archive filestcpdump
: capture network packagestee
: chaining together standard input and outputtelnet
: connect to a remote host using the Telnet protocoltimeout
: run a command with a time limittmux
: run multiple "tabs" in one terminal sessiontouch
: create a new file or update the modification time of an existing filetr
: modify standard outputtraceroute
: display the network path to a hostvisudo
: edit the sudoers file safelytrap
: handle signals and events in shell scriptstune2fs
: adjust tunable file system parameters on ext2/ext3/ext4ufw
: uncomplicated firewall for managing iptables rulesulimit
: set or display user-level resource limitsumount
: remove file systems from the directory treeuname
: display information about the systemuniq
: remove duplicate lines from a fileunset
: unset the value of an environment variableunzip
: unpack files from a ZIP archiveunzstd
: unpack files using ZStandardupdate-alternatives
: configure default programs for your systemuptime
: display the current uptime of the systemuseradd
: add usersuserdel
: delete usersusermod
: modify usersvi
: edit text files with the vi editorvim
: 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 machinesvirt-manager
: manage virtual machinesvisudo
: safely edit the sudoers file, which defines user privileges.vmstat
: display performance statisticswatch
: run a program in regular intervalswc
: count the number of lines, words, and characters in a filewget
: download files from the Webwhereis
: display the location of a command, file, or manual pagewhich
: display the path of a commandwho
: display a list of users which are currently logged inxargs
: transform text into commandsxfs_repair
: repair XFS file systemsxz
: compress or decompress filesyast
: configure a SUSE based systemyum
: install, remove, and manage software packages on Red Hat-based systemszip
: compress files into a ZIP archivezsh
: launch the Z shell, an extended version of the Bourne shell with many featureszstd
: compress or decompress fileszypper
: 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.