Linux commands cheat sheet
Every Linux command grouped by category, with a one-line description for fast lookup. Search by name to jump straight to the one you need.
FILES
catConcatenate and print file contentscpCopy files and directoriesfileDetermine a file's type by inspecting its contentsfindSearch a directory tree for files matching criteriaheadPrint the first lines of a filelessPage through text interactively, one screen at a timelnCreate hard or symbolic links between fileslocateFind files by name using a prebuilt index, fast but can be stalelprSubmit a file to the print queuelsList directory contentsmorePage through text one screen at a time, forward onlymvMove or rename files and directoriesrmRemove files and directoriestailPrint the last lines of a file, and follow it as it growstouchCreate empty files or update file timestampsDIRECTORIES
NETWORKING
curlTransfer data to/from a URL over many protocolsdigQuery DNS servers and display detailed DNS recordsethtoolQuery and change network interface driver and hardware settingsftpInteractive File Transfer Protocol clienthostSimple DNS lookup utilityifconfigDisplay and configure network interfacesnetstatDisplay network connections, routing tables, and listening portspingTest host reachability and measure latency with ICMP echorcpLegacy remote file copy (unencrypted, obsolete)rloginLegacy remote login protocol (unencrypted, obsolete)rshLegacy remote shell/command execution (unencrypted, obsolete)rsyncEfficiently synchronize files and directoriesscpSecurely copy files to/from a remote host over SSHsftpSecure interactive file transfer over SSHsshSecure encrypted remote login and command executiontcpdumpCapture and display network packets on an interfacetelnetConnect to a remote host/port over unencrypted TelnettftpTrivial File Transfer Protocol client for minimal, unauthenticated transferswgetNon-interactive command-line downloaderwhoisLook up domain registration informationPERMISSIONS
USERS
PROCESSES
bgResume a stopped job and run it in the backgroundfgBring a background or stopped job to the foregroundhtopInteractive, colorized process viewer with tree view and mouse supportkillSend a signal to a process by PIDkillallSend a signal to all processes matching a namepsShow a snapshot of currently running processestopInteractive live view of top resource-consuming processesSYSTEM
calDisplay a text calendar in the terminaldateDisplay or set the system date and timedmidecodeRead hardware info from DMI/SMBIOS tablesfreeDisplay system memory usage: RAM and swaphostnameShow or set the system's hostname and IP addresseslastShow login history and system reboot recordslsb_releaseShow Linux Standard Base and distribution informationlspciList PCI devices and hardware attached to the systemlsusbList USB devices and controllers attached to the systemunameDisplay Linux kernel and system informationuptimeShow how long the system has been running and load averageswShow who is logged in and what they are runningwhoamiPrint the current effective usernameDISK
PACKAGE MANAGEMENT
TEXT PROCESSING
awkPattern-scanning and text-processing language for field-based datacmpCompare two files byte by bytecutExtract columns or fields from each line of inputdiffCompare files line by line and show differencesexpandConvert tabs in input to spacesgrepSearch text using patternsjoinJoin lines of two sorted files on a common fieldlookDisplay lines in a sorted file starting with a given stringpasteMerge corresponding lines of files side by side into columnssedStream editor for filtering and transforming textsortSort lines of text filessplitSplit a file into smaller piecestrTranslate, squeeze, or delete characters from inputunexpandConvert runs of spaces back into tabsuniqReport or filter out repeated adjacent lineswcCount lines, words, and bytes or charactersCOMPRESSION
gunzipDecompress .gz filesgzipCompress files using the DEFLATE algorithmtarArchive files into a single .tar file, optionally compresseduncompressRestore files compressed with the legacy .Z formatzcatPrint gzip-compressed file contents to stdoutzcmpCompare compressed files without decompressing to diskzdiffShow line-level differences between compressed fileszmorePage through a compressed file without decompressing it to diskMONITORING
DEVELOPMENT
bcppLegacy C/C++ source code beautifier (mostly superseded)ctraceHistorical C program execution tracer (obsolete, superseded by gdb/strace/ltrace)cxrefGenerate a cross-reference listing of a C program (legacy tool)g++GNU C++ compiler front endgccGNU C compiler front endgeditGNOME's simple graphical text editorindentReformat C source code according to configurable style rulesmakeBuild automation tool that runs rules from a MakefilenmList symbols from object files and executablesperlGeneral-purpose scripting language, historically a sysadmin staple for text processingsizePrint the size of code, data, and BSS sections in an object filestripRemove symbol table and debugging information from a binaryviModal terminal text editor