Essential Linux Commands Cheat Sheet

Essential Linux Commands Cheat Sheet

Command

Description

Command

Description

lsLists the contents of a directory.topShows a real-time view of the running processes.
cdChanges the current directory.killSends a signal to a process.
pwdPrints the current working directory.unameDisplays the system name, release, and version.
mkdirCreates a new directory.dateDisplays or sets the system date and time.
rmdirRemoves an empty directory.man -kSearches the manual pages for a keyword.
cpCopies a file or directory.sudoRuns a command with root privileges.
mvMoves a file or directory.aptInstalls, removes, and manages packages.
rmDeletes a file or directory.yumInstalls, removes, and manages packages on Red Hat-based distributions.
touchCreates a new empty file.pacmanInstalls, removes, and manages packages on Arch Linux.
catDisplays the contents of a file.findFinds files and directories that match a certain criteria.
manDisplays the manual page for a command.grepSearches for a pattern in a file or stream.
infoDisplays the Info documentation for a command.sedEdits a file line by line.
whichShows the path to the executable for a command.awkProcesses text data.
whereisShows the location of the source, binary, and manual page for a command.sortSorts lines of text.
uptimeDisplays the system uptime and load average.uniqRemoves duplicate lines from a file.
freeDisplays the amount of free and used memory.wcCounts the lines, words, and characters in a file.
dfDisplays the disk space usage.tarCreates and extracts archives.
duDisplays the disk space usage of a file or directory.gzipCompresses and decompresses files.
psLists the running processes.bzip2Compresses and decompresses files.
unzipExtracts files from a ZIP archive.mountMounts a filesystem.
unrarExtracts files from a RAR archive.umountUnmounts a filesystem.
clearClears the screen.pingSends ICMP echo requests to a host.
historyDisplays the history of commands that have been executed.tracerouteTraces the route to a host.
exportSets an environment variable.sshConnects to a remote host.
unsetUnsets an environment variable.scpCopies files to and from a remote host.
aliasCreates an alias for a command.wgetDownloads a file from a web server.
unaliasDeletes an alias.curlTransfers data from a server.
jobsLists the running jobs.chmodChanges the permissions of a file or directory.
bgResumes a stopped job in the background.chownChanges the ownership of a file or directory.
fgBrings a stopped job to the foreground.chgrpChanges the group ownership of a file or directory.
killallSends a signal to all processes that match a certain criteria.umaskSets the default permissions for newly created files and directories.
kill -9Sends a SIGKILL signal to a process, which forcibly terminates it.lnCreates a symbolic link.
nohupRuns a command that ignores hangups and keeps running even after you disconnect from the terminal.mknodCreates a special file, such as a device node or a socket.
readlinkDisplays the symbolic link target.mktempCreates a temporary file.
svnSubversion command-line client.crontabEdits the crontab file, which is used to schedule tasks to run at regular intervals.
gitGit command-line client.atSchedules a task to run at a specific time.
htopA more interactive version of top.watchRepeatedly executes a command and displays the output.
vmstatDisplays virtual memory statistics.diffCompares two files or directories.
iostatDisplays I/O statistics.patchApplies a patch to a file or directory.
lsblkLists information about block devices.ifconfigShows network interface information.
df -hDisplays disk space usage in a human-readable format.netstat -tulnLists listening ports.
du -shShows the disk space used by a directory (human-readable).ssh-keygenGenerates SSH key pairs.
chmod +xMakes a file executable.scp -rCopies files and directories recursively over SSH.
chown -RChanges the ownership of a file or directory recursively.wget -ODownloads a file and saves it with a specific name.
find . -nameSearches for files or directories with a specific name.curl -ODownloads a file and saves it with its original name.
grep -rSearches for a pattern recursively in files and directories.tar -czvfCreates a compressed tarball (e.g., .tar.gz file).
ps auxLists all running processes with detailed information.tar -xzvfExtracts files from a compressed tarball.
kill -lLists available signals for the kill command.mount -oMounts a filesystem with specific options.
whoDisplays a list of users currently logged in.umount -lForces an unmount even if the device is busy.
diff -uGenerates a unified diff between two files.watch -nExecutes a command repeatedly with a specified interval.