\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{{[}deleted{]}} \pdfinfo{ /Title (linux-basic-commands.pdf) /Creator (Cheatography) /Author ({[}deleted{]}) /Subject (Linux Basic Commands Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{92B372} \definecolor{LightBackground}{HTML}{F8FAF6} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{Linux Basic Commands Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{{[}deleted{]}} via \textcolor{DarkBackground}{\uline{cheatography.com/124743/cs/23886/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}{[}deleted{]} \\ \uline{cheatography.com/deleted-124743} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Published 3rd August, 2020.\\ Updated 3rd August, 2020.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{2} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Basic comands}} \tn % Row 0 \SetRowColor{LightBackground} `cat {\emph{file1}} {\emph{file2}} {\emph{...}}` & Print the contents of `{\emph{file1}}`, `{\emph{file2}}`, ... \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} `ls` & List the contents of a directory. \tn % Row Count 5 (+ 2) % Row 2 \SetRowColor{LightBackground} `ls -l` & Use a long listing format \tn % Row Count 7 (+ 2) % Row 3 \SetRowColor{white} `ls -a` & Do not ignore entries starting with `.` \tn % Row Count 9 (+ 2) % Row 4 \SetRowColor{LightBackground} `cp {\emph{file1}} {\emph{file2}}` & Copy `{\emph{file1}}` to `{\emph{file2}}` \tn % Row Count 11 (+ 2) % Row 5 \SetRowColor{white} `cp {\emph{file1}} {\emph{...}} {\emph{fileN}} {\emph{dir}}` & Copy a number of files to a directory \tn % Row Count 13 (+ 2) % Row 6 \SetRowColor{LightBackground} `mv {\emph{file1}} {\emph{file2}}` & Rename `{\emph{file1}}` to `{\emph{file2}}` \tn % Row Count 15 (+ 2) % Row 7 \SetRowColor{white} `mv {\emph{file1}} {\emph{...}} {\emph{fileN}} {\emph{dir}}` \{\{nobreak\}\} & Move a number of files to a directory \tn % Row Count 18 (+ 3) % Row 8 \SetRowColor{LightBackground} `touch {\emph{file}}` & Create a file. If the file already exists, `touch` does not change it \tn % Row Count 22 (+ 4) % Row 9 \SetRowColor{white} `rm {\emph{file}}` & Remove a file \tn % Row Count 23 (+ 1) % Row 10 \SetRowColor{LightBackground} `rm -r {\emph{dir}}` & Recursively remove all files and subdirectories in {\emph{dir}} \tn % Row Count 26 (+ 3) % Row 11 \SetRowColor{white} `echo` & Print `echo`'s arguments to the standard output \tn % Row Count 29 (+ 3) % Row 12 \SetRowColor{LightBackground} `pwd` & Print working directory \tn % Row Count 31 (+ 2) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Basic comands (cont)}} \tn % Row 13 \SetRowColor{LightBackground} `pwd -P` & Print true full path, not path of symbolic link \tn % Row Count 3 (+ 3) % Row 14 \SetRowColor{white} `sudo {\emph{command}}` & Run `{\emph{command}}` as root \tn % Row Count 5 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{3.04 cm} x{4.96 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Navigating Directories}} \tn % Row 0 \SetRowColor{LightBackground} `cd {\emph{dir}}` & Change the shell's current working directory \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} `mkdir {\emph{dir}}` \{\{nobreak\}\} & Create a new directory \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} `rmdir {\emph{dir}}` & Remove the directory {\emph{dir}} if {\emph{dir}} is empty \tn % Row Count 6 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{Linux has a directory hierarchy starts at `/` ({\emph{root directory}}). \newline Directory separator is the slash (`/`). \newline Two dots (`..`) refers to the parent of a directory. \newline One dot (`.`) refers to the current directory.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{2.8 cm} x{5.2 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Shell Globbing (Wildcards)}} \tn % Row 0 \SetRowColor{LightBackground} `*` & A number of any characters \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} `?` & A single character \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} `{[}{]}` & Specify a range. `{[}ab{]}` can become: `a`, `b`. `{[}a-c{]}` can become: `a`, `b`, `c` \tn % Row Count 6 (+ 4) % Row 3 \SetRowColor{white} `{[}!{\emph{a-c}}{]}` \{\{nobreak\}\} & Any single character except `{\emph{a}}`, `{\emph{b}}`, `{\emph{c}}` \tn % Row Count 8 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{Globbing is the operation that expands a wildcard pattern into the list of pathnames \newline It is applied on each of the components of a pathname separately. `/` in a pathname cannot be matched. \newline If filename starts with `.`, `.` must be matched explicitly. \newline Wildcard patterns are not regular expressions, they match filenames, not text.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Search files}} \tn % Row 0 \SetRowColor{LightBackground} `grep {\emph{RegEx}} {\emph{file}}` & Search for regular expression pattern in {\emph{file}} \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} `grep -i` & Case-insensitive search \tn % Row Count 5 (+ 2) % Row 2 \SetRowColor{LightBackground} `grep -v` & Print all lines that don't match \tn % Row Count 7 (+ 2) % Row 3 \SetRowColor{white} `find {\emph{dir}} -name {\emph{file}} -print` \{\{nobreak\}\} & Find `{\emph{file}}` in `{\emph{dir}}` and display the pathname of it \tn % Row Count 10 (+ 3) % Row 4 \SetRowColor{LightBackground} `locate {\emph{file}}` & Search an index that the system builds periodically \tn % Row Count 13 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{3.04 cm} x{4.96 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Display a file}} \tn % Row 0 \SetRowColor{LightBackground} `less {\emph{file}}` \{\{nobreak\}\} & Display the contents of `file` one screenful at a time \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} ~ `spacebar` & Go forward one screenful \tn % Row Count 5 (+ 2) % Row 2 \SetRowColor{LightBackground} ~ `b` & Skip back one screenful \tn % Row Count 6 (+ 1) % Row 3 \SetRowColor{white} ~ `/{\emph{word}}` & Search forward for `{\emph{word}}` \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} ~ `?{\emph{word}}` & Search backward for `{\emph{word}}` \tn % Row Count 10 (+ 2) % Row 5 \SetRowColor{white} ~ `q` & Quit `less` \tn % Row Count 11 (+ 1) % Row 6 \SetRowColor{LightBackground} `head {\emph{file}}` & Display the first 10 lines of `{\emph{file}}` \tn % Row Count 13 (+ 2) % Row 7 \SetRowColor{white} `tail {\emph{file}}` & Display the last 10 lines of `{\emph{file}}` \tn % Row Count 15 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{3.68 cm} x{4.32 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Differences between text files}} \tn % Row 0 \SetRowColor{LightBackground} `diff {\emph{file1}} {\emph{file2}}` \{\{nobreak\}\} & Print differences between two text files \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} `diff -{}-color` & Print differences with color \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} `diff -y` & Print differences side by side \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} `diff -c` & View differences in context mode \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} `diff -i` & Ignore case differences \tn % Row Count 10 (+ 2) % Row 5 \SetRowColor{white} `diff -w` & Ignore all white space \tn % Row Count 12 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{`diff` gives the instructions on how to change the first file to make it match the second file. \newline `\textless{}` denotes lines in `{\emph{file1}}`. `\textgreater{}` denotes lines in `{\emph{file2}}`. \newline {\bf{Change command}} \newline `LaR`: Add the lines in range R of the second file after line L of the first file. \newline `FcT`: Replace the lines in range F of the first file with lines in range T of the second file. \newline `RdL`: Delete the lines in range R from the first file so that both the files sync up at line L.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{3.44 cm} x{4.56 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Environment and Shell Variables}} \tn % Row 0 \SetRowColor{LightBackground} `stuff=blah` & Create a shell variable/Assign a value to a variable \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} `PATH=\$PATH:{\emph{dir}}` \{\{nobreak\}\} & Appends "`:{\emph{dir}}`" to the end of `PATH` variable \tn % Row Count 6 (+ 3) % Row 2 \SetRowColor{LightBackground} `\$STUFF` & Access a variable \tn % Row Count 7 (+ 1) % Row 3 \SetRowColor{white} `export STUFF` & Make `\$STUFF` shell variable into an environment variable \tn % Row Count 10 (+ 3) % Row 4 \SetRowColor{LightBackground} `unset STUFF` & Delete variable `STUFF` \tn % Row Count 12 (+ 2) % Row 5 \SetRowColor{white} `env` & Prints environment variables \tn % Row Count 14 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{{\emph{Shell variables}} are variables whose scope is in the current shell session. \newline {\emph{Environment variables}} are shell variables which has been exported. Children processes get their own copy of the parent variables so they can never change the environment variables in their parent process. Environment variables must be `name=value` pair. \newline {\bf{Command path}} \newline `PATH` is environment variable that contains {\emph{command path}} (list of system directories that the shell searches when trying to locate a command).} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{2.48 cm} x{5.52 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Command-Line Editing}} \tn % Row 0 \SetRowColor{LightBackground} CTRL-B & Move the cursor left \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} CTRL-F & Move the cursor right \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} CTRL-A & Move the cursor to the beginning of the line \tn % Row Count 4 (+ 2) % Row 3 \SetRowColor{white} CTRL-E & Move the cursor to the end of the line \tn % Row Count 6 (+ 2) % Row 4 \SetRowColor{LightBackground} CTRL-W \{\{nobreak\}\} & Erase the preceding word \tn % Row Count 8 (+ 2) % Row 5 \SetRowColor{white} CTRL-U & Erase from cursor to beginning of line \tn % Row Count 10 (+ 2) % Row 6 \SetRowColor{LightBackground} CTRL-K & Erase from cursor to end of line \tn % Row Count 12 (+ 2) % Row 7 \SetRowColor{white} CTRL-Y & Paste erased text \tn % Row Count 13 (+ 1) % Row 8 \SetRowColor{LightBackground} CTRL-D & Stop the current standard input entry from the terminal \tn % Row Count 16 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{3.52 cm} x{4.48 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Getting Online Help}} \tn % Row 0 \SetRowColor{LightBackground} `man {\emph{command}}` & Show manual page for `{\emph{command}}` \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} `man -k {\emph{keyword}}` & Search for a manual page by `{\emph{keyword}}` \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} `man {\emph{n}} {\emph{command}}` \{\{nobreak\}\} & Show manual page for `{\emph{command}}` from section `{\emph{n}}` \tn % Row Count 7 (+ 3) % Row 3 \SetRowColor{white} \mymulticolumn{2}{x{8.4cm}}{{\bf{Online Manual Sections}}} \tn % Row Count 8 (+ 1) % Row 4 \SetRowColor{LightBackground} 1 & User commands \tn % Row Count 9 (+ 1) % Row 5 \SetRowColor{white} 2 & System calls \tn % Row Count 10 (+ 1) % Row 6 \SetRowColor{LightBackground} 3 & Higher-level Unix programming library documentation \tn % Row Count 13 (+ 3) % Row 7 \SetRowColor{white} 4 & Device interface and driver information \tn % Row Count 15 (+ 2) % Row 8 \SetRowColor{LightBackground} 5 & File descriptions (system configuration files) \tn % Row Count 18 (+ 3) % Row 9 \SetRowColor{white} 6 & Games \tn % Row Count 19 (+ 1) % Row 10 \SetRowColor{LightBackground} 7 & File formats, conventions, and encodings (ASCII, suffixes, and so on) \tn % Row Count 23 (+ 4) % Row 11 \SetRowColor{white} 8 & System commands and servers \tn % Row Count 25 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{Manual pages cover the essentials, but there are many more ways to get online help. Try entering a command name followed by `-{}-help` or `-h` to look for a certain option for a command} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{3.84 cm} x{4.16 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Shell Input and Output}} \tn % Row 0 \SetRowColor{LightBackground} `{\emph{command}} \textgreater{} {\emph{file}}` & Send the output of `{\emph{command}}` to a file \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} `{\emph{command}} \textgreater{}\textgreater{} {\emph{file}}` & Append output to the `{\emph{file}}` \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} `{\emph{command}} \textless{} {\emph{file}}` & Channel a file to a program's standard input \tn % Row Count 7 (+ 3) % Row 3 \SetRowColor{white} `{\emph{command1}} | {\emph{command2}}` \{\{nobreak\}\} & Send the standard output of `{\emph{command1}}` to the standard input of `{\emph{command2}}` \tn % Row Count 11 (+ 4) % Row 4 \SetRowColor{LightBackground} `{\emph{command}} 2\textgreater{} {\emph{file}}` & Redirect the standard error (`2` is standard error stream ID) \tn % Row Count 15 (+ 4) % Row 5 \SetRowColor{white} `{\emph{command}} \&\textgreater{} {\emph{file}}` & Redirect the all output to `{\emph{file}}` \tn % Row Count 17 (+ 2) % Row 6 \SetRowColor{LightBackground} `{\emph{command}} 2\textgreater{}\&1` & Send standard error to the same place as standard output \tn % Row Count 20 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Listing and Manipulating Processes}} \tn % Row 0 \SetRowColor{LightBackground} `ps` & List processes owned by root \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} `ps x` & List all processes owned by you \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} `ps ax` & List all processes on the system \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} `ps u` & Include more detailed information on processes \tn % Row Count 9 (+ 3) % Row 4 \SetRowColor{LightBackground} `ps w` & Show full command names \tn % Row Count 11 (+ 2) % Row 5 \SetRowColor{white} \{\{bb\}\} & \{\{bb\}\} \tn % Row Count 12 (+ 1) % Row 6 \SetRowColor{LightBackground} `top` & Show real-time view of running system \tn % Row Count 14 (+ 2) % Row 7 \SetRowColor{white} \{\{bb\}\} & \{\{bb\}\} \tn % Row Count 15 (+ 1) % Row 8 \SetRowColor{LightBackground} `kill {\emph{pid}}` & Send `TERM`inate signal to the process with ID `{\emph{pid}}` \tn % Row Count 18 (+ 3) % Row 9 \SetRowColor{white} `kill -STOP {\emph{pid}}` or CTRL-Z \{\{nobreak\}\} & Send `STOP` (freeze) signal to the process \tn % Row Count 21 (+ 3) % Row 10 \SetRowColor{LightBackground} `kill -CONT {\emph{pid}}` & `CONT`inue running the process again \tn % Row Count 23 (+ 2) % Row 11 \SetRowColor{white} `kill -INT {\emph{pid}}` or CTRL-C & End process with `INT`errupt signal \tn % Row Count 25 (+ 2) % Row 12 \SetRowColor{LightBackground} `kill -KILL {\emph{pid}}` & Terminate the process and forcibly remove it from memory \tn % Row Count 28 (+ 3) % Row 13 \SetRowColor{white} \{\{bb\}\} & \{\{bb\}\} \tn % Row Count 29 (+ 1) % Row 14 \SetRowColor{LightBackground} `jobs -l` & List the active jobs with their status and pid (`-l`) \tn % Row Count 32 (+ 3) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Listing and Manipulating Processes (cont)}} \tn % Row 15 \SetRowColor{LightBackground} `fg \%{\emph{n}}` & Move job that have job number `{\emph{n}}` to the foreground \tn % Row Count 3 (+ 3) % Row 16 \SetRowColor{white} `bg \%{\emph{n}}` & Move job that have job number `{\emph{n}}` to the background \tn % Row Count 6 (+ 3) % Row 17 \SetRowColor{LightBackground} `{\emph{command}} \&` & Run `{\emph{command}}` in background \tn % Row Count 8 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{The `ps` command has many options. Options can be specified in three different styles—Unix, BSD, and GNU. Above commands use BSD style.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{3.84 cm} x{4.16 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{File Modes and Permissions}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{File's mode represents the file's permission and some extra information. There is 4 parts to the mode. First character is file type. The rest contains the permissions, which break down into three sets: {\emph{user}}, {\emph{group}}, {\emph{other}}, in that order. Each set can contain four basic representations:} \tn % Row Count 6 (+ 6) % Row 1 \SetRowColor{white} `r` & Means that the file is readable \tn % Row Count 8 (+ 2) % Row 2 \SetRowColor{LightBackground} `w` & Means that the file is writable \tn % Row Count 10 (+ 2) % Row 3 \SetRowColor{white} `x` & Means that the file is executable \tn % Row Count 12 (+ 2) % Row 4 \SetRowColor{LightBackground} `-` & Means nothing \tn % Row Count 13 (+ 1) % Row 5 \SetRowColor{white} \mymulticolumn{2}{x{8.4cm}}{{\bf{Modifying Permissions}}} \tn % Row Count 14 (+ 1) % Row 6 \SetRowColor{LightBackground} `chmod {\emph{ugo+r file}}` & Add (`{\emph{+}}`) owner (`{\emph{u}}`), group (`{\emph{g}}`) and other users (`{\emph{o}}`) read (`{\emph{r}}`) permissions to `{\emph{file}}` \tn % Row Count 20 (+ 6) % Row 7 \SetRowColor{white} `chmod {\emph{644 file}}` & Set `{\emph{file}}` mode to absolute permission mode `{\emph{644}}` \tn % Row Count 23 (+ 3) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{{\bf{Symbolic links}} \{\{nl\}\} A symbolic links is a file that points to another file or a directory} \tn % Row Count 25 (+ 2) % Row 9 \SetRowColor{white} `ln -s {\emph{target linkname}}` \{\{nobreak\}\} & Create a symbolic link from `{\emph{target}}` to `{\emph{linkname}}` \tn % Row Count 28 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Archiving and Compressing Files}} \tn % Row 0 \SetRowColor{LightBackground} `gzip {\emph{file}}` & Compress `{\emph{file}}` to `{\emph{file.gz}}` \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} `gunzip {\emph{file.gz}}` or `gzip -d` & Uncompress `{\emph{file.gz}}` and remove the suffix \tn % Row Count 5 (+ 3) % Row 2 \SetRowColor{LightBackground} `tar cf {\emph{archive.tar file1 file2}}` & Create (`c`) an archive name (`f`) `{\emph{archive.tar}}` contains `{\emph{file1}}`, `{\emph{file2}}` \tn % Row Count 9 (+ 4) % Row 3 \SetRowColor{white} `tar xf {\emph{archive.tar}}` & Unpack (`x`) `{\emph{archive.tar}}` \tn % Row Count 11 (+ 2) % Row 4 \SetRowColor{LightBackground} `tar tf {\emph{archive.tar}}` & List the contents (`t`) of `{\emph{archive.tar}}` \tn % Row Count 14 (+ 3) % Row 5 \SetRowColor{white} `gunzip -c {\emph{file.tar.gz}} | tar xf -` \{\{nobreak\}\} \{\{nl\}\} `zcat {\emph{file.tar.gz}} | tar xf -` \{\{nl\}\} `tar zxf {\emph{file.tar.gz}}` & Unpack compressed archive `{\emph{file.tar.gz}}` \tn % Row Count 20 (+ 6) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{`gunzip -c` uncompresses archive then sends the result to standard output. \newline `tar xf -` uses standard input instead of a given filename.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Some subdirectories in root}} \tn % Row 0 \SetRowColor{LightBackground} `/bin` & Contains ready-to-run programs including most of the basic Linux commands \tn % Row Count 4 (+ 4) % Row 1 \SetRowColor{white} `/dev` & Contains device files \tn % Row Count 6 (+ 2) % Row 2 \SetRowColor{LightBackground} `/etc` & Core system configuration directory that contains the user password, boot, device, networking, and other setup files \tn % Row Count 12 (+ 6) % Row 3 \SetRowColor{white} `/home` & Holds personal directories for regular users \tn % Row Count 15 (+ 3) % Row 4 \SetRowColor{LightBackground} `/lib` & Holds library files \tn % Row Count 16 (+ 1) % Row 5 \SetRowColor{white} `/proc` & Provices system statistics \tn % Row Count 18 (+ 2) % Row 6 \SetRowColor{LightBackground} `/sys` & Provides a device and system interface \tn % Row Count 20 (+ 2) % Row 7 \SetRowColor{white} `/sbin` & Place for system management programs \tn % Row Count 22 (+ 2) % Row 8 \SetRowColor{LightBackground} `/tmp` & Storage area for temporary files \tn % Row Count 24 (+ 2) % Row 9 \SetRowColor{white} `/usr` & Other bulk of Linux system \tn % Row Count 26 (+ 2) % Row 10 \SetRowColor{LightBackground} `/var` & Where programs record runtime information \tn % Row Count 29 (+ 3) % Row 11 \SetRowColor{white} `/boot` & Contains kernel boot loader files \tn % Row Count 31 (+ 2) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Some subdirectories in root (cont)}} \tn % Row 12 \SetRowColor{LightBackground} `/media` & A base attachment point for removable media \tn % Row Count 3 (+ 3) % Row 13 \SetRowColor{white} `/opt` & This may contain additional third-party software \tn % Row Count 6 (+ 3) % Row 14 \SetRowColor{LightBackground} `/vmlinuz` \{\{nl\}\} or `/boot/vmlinuz` \{\{nobreak\}\} & Kernel location \tn % Row Count 9 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{The reason that the root directory does not contain the complete system but other parts stored in `/usr` is primarily historic—in the past, it was to keep space requirements low for the root} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}