\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{River L. (Tamaranth)} \pdfinfo{ /Title (linux-info-and-navigation.pdf) /Creator (Cheatography) /Author (River L. (Tamaranth)) /Subject (Linux Info \& Navigation 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}{009152} \definecolor{LightBackground}{HTML}{EFF8F4} \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 Info \& Navigation Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{River L. (Tamaranth)} via \textcolor{DarkBackground}{\uline{cheatography.com/42882/cs/46704/}}} \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}River L. (Tamaranth) \\ \uline{cheatography.com/tamaranth} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Not Yet Published.\\ Updated 6th July, 2025.\\ 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{3.52 cm} x{4.48 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Keyboard Shortcuts}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{{\emph{Shortcut}}}} & {\bf{{\emph{What It Does}}}} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} `{\emph{abc}}` {\bf{Tab Tab}} & Show all commands that start with "{\emph{abc}}" \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} {\bf{Esc}} + {\bf{.}} & Insert last argument entered\{\{nl\}\}(repeat to go back to previous arguments) \tn % Row Count 7 (+ 4) % Row 3 \SetRowColor{white} {\bf{Up Arrow}} & Auto-fill last command entered\{\{nl\}\}(repeat to go back to previous arguments) \tn % Row Count 11 (+ 4) % Row 4 \SetRowColor{LightBackground} {\bf{Ctrl}}+{\bf{Arrow}} (Right/Left) & Move to beginning/end of a word \tn % Row Count 13 (+ 2) % Row 5 \SetRowColor{white} {\bf{Ctrl}}+{\bf{Shift}}+{\bf{T}} & Open new terminal tab \tn % Row Count 15 (+ 2) % Row 6 \SetRowColor{LightBackground} {\bf{Ctrl}}+{\bf{L}} & Clear terminal output \tn % Row Count 16 (+ 1) % Row 7 \SetRowColor{white} {\bf{Ctrl}}+{\bf{D}} & Logout / Exit \tn % Row Count 17 (+ 1) \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}{Important Directories \& Files}} \tn % Row 0 \SetRowColor{LightBackground} \{\{bb=1\}\}\{\{nobreak\}\}\{\{width=30\}\}{\bf{{\emph{Directory/File}}}} & \{\{bb=1\}\}\{\{noshy\}\}{\bf{{\emph{(Stands For) Purpose}}}} \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} {\bf{/root}} & Root user's home directory \tn % Row Count 5 (+ 2) % Row 2 \SetRowColor{LightBackground} {\bf{/home}} & Normal users' home directories \tn % Row Count 7 (+ 2) % Row 3 \SetRowColor{white} {\bf{/var}} & (Variables) Database locations, spool files for mail, etc. \tn % Row Count 10 (+ 3) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{} \tn % Row Count 10 (+ 0) % Row 5 \SetRowColor{white} \{\{bt=1\}\}{\bf{/usr}} & \{\{bt=1\}\}(User System Resources) System resources used by users \tn % Row Count 14 (+ 4) % Row 6 \SetRowColor{LightBackground} — /usr{\bf{/bin}} & (Binaries) Executables usable by normal users \tn % Row Count 17 (+ 3) % Row 7 \SetRowColor{white} — /usr{\bf{/sbin}} & (System Binaries) Executables only usable by root user \tn % Row Count 20 (+ 3) % Row 8 \SetRowColor{LightBackground} — /usr{\bf{/lib}} & 52-bit libraries \tn % Row Count 21 (+ 1) % Row 9 \SetRowColor{white} — /usr{\bf{/lib64}} & 64-bit libraries \tn % Row Count 22 (+ 1) % Row 10 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{} \tn % Row Count 22 (+ 0) % Row 11 \SetRowColor{white} \{\{bt=1\}\}{\bf{/etc}} & \{\{bt=1\}\}(Extended Text Configurations) Config files \tn % Row Count 25 (+ 3) % Row 12 \SetRowColor{LightBackground} — /etc{\bf{/passwd}} & User account config files \tn % Row Count 27 (+ 2) % Row 13 \SetRowColor{white} — /etc{\bf{/group}} & Group membership info \& config files \tn % Row Count 29 (+ 2) % Row 14 \SetRowColor{LightBackground} — /etc{\bf{/shadow}} & User password info \& configs \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}{Important Directories \& Files (cont)}} \tn % Row 15 \SetRowColor{LightBackground} — /etc{\bf{/sudoers}} & Main file for sudo config \tn % Row Count 2 (+ 2) % Row 16 \SetRowColor{white} — /etc{\bf{/sudoers.d/}} & Destination for sudo config "drop-in files" \tn % Row Count 5 (+ 3) % Row 17 \SetRowColor{LightBackground} — /etc{\bf{/login.defs}} & Defines default properties used for new user accounts \tn % Row Count 8 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{1.824 cm} x{2.204 cm} x{3.572 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{8.4cm}}{\bf\textcolor{white}{Process States}} \tn % Row 0 \SetRowColor{LightBackground} Running & `{\bf{R}}` & currently using CPU \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} Runnable & `{\bf{R}}` & queued \& waiting for CPU time \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} \{\{rowspan=4\}\}Sleeping & `{\bf{S}}` & defined (has PID) but not requesting CPU time \tn % Row Count 7 (+ 3) % Row 3 \SetRowColor{white} & \{\{nobreak\}\}`{\bf{I}}` (idle) & not counted when calculating load \tn % Row Count 10 (+ 3) % Row 4 \SetRowColor{LightBackground} & `{\bf{D}}` & {\emph{(not yet addressed)}} \tn % Row Count 12 (+ 2) % Row 5 \SetRowColor{white} & `{\bf{K}}` & {\emph{(not yet addressed)}} \tn % Row Count 14 (+ 2) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{3}{x{8.4cm}}{} \tn % Row Count 14 (+ 0) % Row 7 \SetRowColor{white} Stopped & `{\bf{T}}` & defined (has PID) but prevented from getting CPU cycles \tn % Row Count 18 (+ 4) \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}{Wildcards \& Shortcuts}} \tn % Row 0 \SetRowColor{LightBackground} \{\{nobreak\}\}{\bf{{\emph{Wildcard}}}} & {\bf{{\emph{What It Represents}}}}\{\{nl\}\}{\bf{{\emph{\textless{} Example \textgreater{}}}}} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} `{\bf{\textasciitilde{}}}` & Current user's home directory \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} `{\bf{.}}` & The directory you're currently in \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} `{\bf{..}}` & Parent directory of your current directory \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} `{\bf{*}}` & All files in current directory\{\{nl\}\}\textless{} `{\bf{ls i*}}` = all files starting with "i" \textgreater{} \tn % Row Count 12 (+ 4) % Row 5 \SetRowColor{white} `{\bf{?}}` & "Any character"\{\{nl\}\}\textless{} `{\bf{f??e}}` = anything with 4 chars that starts with `{\bf{f}}` and ends with `{\bf{e}}` \textgreater{} \tn % Row Count 17 (+ 5) % Row 6 \SetRowColor{LightBackground} `{\bf{{[}}}{\emph{aou{\bf{}}{]}}}` & Match to any {\bf{one}} of the enclosed characters\{\{nl\}\}\textless{} `{\bf{c{[}aou{]}t}}` = "cat", "cot", \& "cut" \textgreater{} \tn % Row Count 21 (+ 4) % Row 7 \SetRowColor{white} `{\bf{!!}}` & "Last command run"\{\{nl\}\}\textless{} `{\bf{sudo !!}}` = rerun last command as root \textgreater{} \tn % Row Count 24 (+ 3) % Row 8 \SetRowColor{LightBackground} `{\bf{\textasciicircum{}}}{\emph{x{\bf{}}\textasciicircum{}}}{\emph{y}}` & Rerun last command but replace {\emph{x}} with {\emph{y}}\{\{nl\}\}\textless{} `{\bf{\textasciicircum{}usr\textasciicircum{}tmp}}` after running `{\bf{ls /usr}}` will run `{\bf{ls /tmp}}` \textgreater{} \tn % Row Count 29 (+ 5) % Row 9 \SetRowColor{white} `{\bf{!}}{\emph{3}}` & Rerun 3rd command from command history \tn % Row Count 31 (+ 2) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{3.04 cm} x{4.96 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Wildcards \& Shortcuts (cont)}} \tn % Row 10 \SetRowColor{LightBackground} `{\bf{!}}{\emph{ls}}` & Run most recent command with "ls" in it \tn % Row Count 2 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{3.28 cm} x{4.72 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{`vim` Editor Controls}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{\{\{ac\}\}\{\{colspan=2\}\}{\bf{-{}-{}- Command Mode -{}-{}-}}} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} {\bf{o}} & Starts new line {\bf{and}} switches to Insert mode \tn % Row Count 4 (+ 3) % Row 2 \SetRowColor{LightBackground} {\bf{cw}} & "Change word" - deletes word {\bf{and}} switches to Insert mode \tn % Row Count 7 (+ 3) % Row 3 \SetRowColor{white} {\bf{G}} & Go to end of file \tn % Row Count 8 (+ 1) % Row 4 \SetRowColor{LightBackground} {\bf{dd}} & Delete {\bf{or cut}} entire line \tn % Row Count 10 (+ 2) % Row 5 \SetRowColor{white} {\bf{yy}} & Copy entire line \tn % Row Count 11 (+ 1) % Row 6 \SetRowColor{LightBackground} {\bf{p}} & Paste copied text \tn % Row Count 12 (+ 1) % Row 7 \SetRowColor{white} {\bf{x}} & Delete character cursor is on top of \tn % Row Count 14 (+ 2) % Row 8 \SetRowColor{LightBackground} {\bf{dw}} & Delete word cursor is on top of \tn % Row Count 16 (+ 2) % Row 9 \SetRowColor{white} {\bf{d\$}} & Delete from cursor to end of line \tn % Row Count 18 (+ 2) % Row 10 \SetRowColor{LightBackground} {\bf{ZZ}} & Save \& quit (existing files) \tn % Row Count 20 (+ 2) % Row 11 \SetRowColor{white} \mymulticolumn{2}{x{8.4cm}}{\{\{bt=1\}\}\{\{ac\}\}\{\{colspan=2\}\}{\bf{-{}-{}- Extended Command Mode -{}-{}-}}} \tn % Row Count 22 (+ 2) % Row 12 \SetRowColor{LightBackground} \{\{nobreak\}\}{\bf{:w}} {\emph{filename}} & Save (new files) \tn % Row Count 24 (+ 2) % Row 13 \SetRowColor{white} {\bf{:wq}} & Save \& quit (existing files) \tn % Row Count 26 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{1.596 cm} x{2.28 cm} x{3.724 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{8.4cm}}{\bf\textcolor{white}{Process Signals}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{{\emph{Number/Name}}}} & {\bf{{\emph{Stands For}}}} & {\bf{{\emph{What It Does}}}} \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} `{\bf{1) SIGHUP}}` & Hang Up & toss current config file in memory \& reload it from the file system \tn % Row Count 7 (+ 4) % Row 2 \SetRowColor{LightBackground} `{\bf{9) SIGKILL}}` & \{\{nobreak\}\}Kill it dead! & immediately end process that isn't responding to "terminate" signal \tn % Row Count 11 (+ 4) % Row 3 \SetRowColor{white} `{\bf{15) SIGTERM}}` & Terminate & shut down process\{\{nl\}\}(default used by `kill` command) \tn % Row Count 14 (+ 3) % Row 4 \SetRowColor{LightBackground} `{\bf{18) SIGCONT}}` & Continue & resume allowing process to get CPU time ("unstop") \tn % Row Count 17 (+ 3) % Row 5 \SetRowColor{white} `{\bf{19) SIGSTOP}}` & Stop & suspend process \& prevent from getting CPU time \tn % Row Count 20 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}