\item[rm -r <directory>] Remove a non-empty directory
\item[rm -ri <directory>] Remove a non-empty directory recursively, and require confirmation of each item
\end{description}
\section*{Archives}
\begin{description}
\item[tar]Archive multiple files into a common Linux file format (\textbf{Note:}\texttt{tar} files are \textit{not} compressed.)
\item[tar -xf file.tar] Extract an archived file
\item[tar -cf file.tar file1.txt file2.txt] Create an archive from one or more files
\item[tar -czf file.txt file.tar.gz] Create a gzip-compressed file (\textbf{Note:} the file extensions \texttt{.tar.gz} and \texttt{.tgz} are equivalent.)
\item[gzip file] Compress a file with the \texttt{.gz} extension
\item[gpg -c <file>] Encrypt a file
\item[gpg <file>] Decrypt a file
\item[zip <archive.zip> <file1> <file2>] Compress files into a zip archive
\item[unzip <archive.zip>] Extract zipped files from a zip archive
\item[hostname] Display the name of your host or network
\item[ip addr show] Show IP addresses and network interfaces
\item[ping] Check connectivity to a server
\item[ifconfig] Show IP addresses of all network interfaces
\item[netstat -pnltu] Show active ports
\item[netstat -nutlp] Show more information about a domain
\item[whois <domain>] Show more information about a domain
\item[dig <domain>] Show DNS information about a domain
\item[host <domain>] Do an IP lookup for a domain
\item[hostname -i] Show the IP address of the system
\end{description}
\section*{Users, Groups, and Permissions}
\begin{description}
\item[id] Show information about the current user
\item[useradd] Create a new user
\item[passwrd] Add a password to a user's account
\item[last] Show last logins
\item[userdel <user>] Delete a user
\item[chmod] Change the read, write, and execute permissions of files and directories
\item[chmod u + x <file>] Give the user execute permissions on a file
\item[chmod u+rw,go+r <file>] Give read and write permissions to the owner, and read-only permissions to the group and others.
\item[chmod -R 755 <directory>] Change the permissions of a directory and its files recursively
\item[chown] Change or transfer file ownership
\item[chown <user> <file>] Change the ownership of a file to a given user
\item[chown :<group> <file>] Change the group of a file to a given group (\textbf{Note:} Instead of the group permissions, the user permissions will apply if the owner user is in this group.)
\item[sudo] Perform tasks as the root user
\end{description}
Permissions are always in the order: owner, group, others.
\hspace{1em} Calculate permission digits by adding these numbers:
\begin{itemize}[noitemsep]
\item 4 — read (r)
\item 2 — write (w)
\item 1 — execute (x)
\end{itemize}
\section*{Pipes and Redirection}
\begin{description}
\item[cmd1 | cmd2] Pipe the \texttt{stdout} of the first command to the second command
\item[cmd1 |\& cmd2] Pipe the \texttt{stderr} of the first command to the second command
\item[cmd1 > file.txt] Redirect the \texttt{stdout} of a command to a file
\item[cmd1 2>error.log] Redirect the \texttt{stderr} of a commmand to a log file