Linux command manual
59 commands explained with syntax, options, copy-ready examples and each one's typical mistakes. It is the cheat sheet that goes with the course.
Navigation4
Files and folders8
touchCreates an empty file or updates its modification date.
mkdirCreates folders. With -p it also creates any missing parents.
cpCopies files. For whole folders it needs -r.
mvMoves files or folders. It also renames.
rmDeletes files. With -r, whole folders. There is no recycle bin.
rmdirDeletes folders, but only if they are empty. It is the safe option.
lnCreates links: a shortcut to another file on the system.
statShows the full technical record of a file: size, permissions, dates and owner.
Reading files5
catShows the whole content of a file. It also joins several on screen.
lessOpens the file page by page: you can move, search and quit whenever you want.
headShows the first lines of a file (10 by default).
tailShows the last lines of a file. The log watcher's command.
wcCounts lines, words and characters. With pipes it is a result counter.
Search3
Text and processing6
sortSorts the lines of a file or of the input. Alphabetical by default.
uniqRemoves consecutive repeated lines and, with -c, counts them.
cutCuts columns or fields from each line. Ideal for separated listings.
trChanges or deletes characters. Very useful to uppercase or clean text.
sedEdits text as a stream: above all, replaces words inside lines.
awkProcesses text by columns and lets you filter and compute in one line.
Permissions and owners4
Users6
whoamiTells which user you are working as right now.
idShows your user number, your main group and the groups you belong to.
suSwitches user inside the same session. It asks for the other user's password.
useraddCreates a new user account. It requires administrator privileges.
userdelDeletes a user account. With -r it also deletes their home folder.
passwdChanges a user's password. With no arguments, your own.
System and processes6
psShows the processes running on the system.
dfShows the free and used space of mounted disks.
duMeasures how much a folder or file takes. The space detective.
freeShows the available RAM and swap area.
unameShows system information: kernel, architecture and host name.
uptimeTells how long the machine has been on and the system load average.
Network9
pingChecks whether a host responds and how long it takes.
tracerouteShows the path a packet travels to its destination, hop by hop.
ipInspects and configures the network: addresses, routes and interfaces.
ifconfigThe classic to see network configuration. Today ip is preferred.
ssLists the connections and ports listening on your machine.
sshOpens a session on another machine, encrypted. The gateway to servers.
scpCopies files between your machine and another over the ssh connection.
curlRequests a URL and shows the response. The command to talk to web services.
wgetDownloads files from the internet with a single command.
Packages and backups2
Session and utilities6
echoPrints text on screen. With redirection, it writes to files.
historyShows the commands you have typed in this session, numbered.
aliasCreates custom shortcuts for long commands.
exportDefines environment variables: named values your programs use.
envShows all current environment variables.
manOpens the official manual of a command: Linux's source of truth.