\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{mmorykan} \pdfinfo{ /Title (common-commands.pdf) /Creator (Cheatography) /Author (mmorykan) /Subject (Common 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}{A33412} \definecolor{LightBackground}{HTML}{F9F2F0} \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{Common Commands Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{mmorykan} via \textcolor{DarkBackground}{\uline{cheatography.com/89673/cs/20411/}}} \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}mmorykan \\ \uline{cheatography.com/mmorykan} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Published 18th December, 2019.\\ Updated 28th January, 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*}{3} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Scripting}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{bash filename}} - Runs script} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{Shebang}} - "\#!bin/bash" - First line of bash script. Tells script what binary to use} \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{./filename}} - Also runs script} \tn % Row Count 4 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{\#}} - Creates a comment} \tn % Row Count 5 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{echo \$\{variable\}}} - Prints variable} \tn % Row Count 6 (+ 1) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{hello\_int = 1}} - Treats "1" as a string} \tn % Row Count 7 (+ 1) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{Use {\emph{UPPERCASE}} for constant variables} \tn % Row Count 8 (+ 1) % Row 7 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{Use {\emph{lowercase\_with\_underscores}} for regular variables} \tn % Row Count 10 (+ 2) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{echo \$(( \$\{hello\_int\} + 1 ))}} - Treats hello\_int as an integer and prints 2} \tn % Row Count 12 (+ 2) % Row 9 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{mktemp}} - Creates temporary random file} \tn % Row Count 13 (+ 1) % Row 10 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{test}} - Denoted by "{[}{[} condition {]}{]}" tests the condition} \tn % Row Count 15 (+ 2) % Row 11 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{bash -x}} - Prints commands and their arguments} \tn % Row Count 16 (+ 1) % Row 12 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{ps -f}} - Copies the current shell in the fork} \tn % Row Count 17 (+ 1) % Row 13 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{exit {\bf{value}}}} - Exits the script with {\bf{value}} exit code} \tn % Row Count 19 (+ 2) % Row 14 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{-n {\bf{variable}}}} - decides if variable is not empty} \tn % Row Count 21 (+ 2) % Row 15 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{-z {\bf{variable}}}} - Decides if variable is empty} \tn % Row Count 22 (+ 1) % Row 16 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{\$?}} - Stands for the previous exit code} \tn % Row Count 23 (+ 1) % Row 17 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{\$\#}} - Stands for the number of arguments passed} \tn % Row Count 24 (+ 1) % Row 18 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{{[}{[} \$\# -ne 2 {]}{]}}} - Evaluates to true if the number of arguments is not equal to 2} \tn % Row Count 26 (+ 2) % Row 19 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{-f {\bf{filename}}}} - Determines if {\bf{filename}} is a file} \tn % Row Count 28 (+ 2) % Row 20 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{-d {\bf{directoryName}}}} - Determines if {\bf{directoryName}} is a directory} \tn % Row Count 30 (+ 2) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Scripting (cont)}} \tn % Row 21 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{\$1, \$2, \$3}} - Refers to the first, second, and third arguments} \tn % Row Count 2 (+ 2) % Row 22 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{-eq}} - means ==} \tn % Row Count 3 (+ 1) % Row 23 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{-lt}} - Means \textless{}} \tn % Row Count 4 (+ 1) % Row 24 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{-le}} - Means \textless{}=} \tn % Row Count 5 (+ 1) % Row 25 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{-gt}} - Means \textgreater{}} \tn % Row Count 6 (+ 1) % Row 26 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{-ge}} - Means \textgreater{}=} \tn % Row Count 7 (+ 1) % Row 27 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{dirname}} - Prints directory name of of argument} \tn % Row Count 8 (+ 1) % Row 28 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{sleep {\bf{value}}}} - Forces the script to wait {\bf{value}} seconds} \tn % Row Count 10 (+ 2) % Row 29 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{while {[}{[} condition {]}{]}; do stuff; done} \tn % Row Count 11 (+ 1) % Row 30 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{if {[}{[} condition {]}{]}; do stuff; fi} \tn % Row Count 12 (+ 1) % Row 31 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{until {[}{[} condition {]}{]}; do stuff; done} \tn % Row Count 13 (+ 1) % Row 32 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{words="house dogs telephone dog" - Declares words array} \tn % Row Count 15 (+ 2) % Row 33 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{for word in \$\{words\} - traverses each element in array} \tn % Row Count 17 (+ 2) % Row 34 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{for counter in \{1..10\} - Loops 10 times} \tn % Row Count 18 (+ 1) % Row 35 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{for ((;;)) - Is infinite for loop} \tn % Row Count 19 (+ 1) % Row 36 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{break}} - exits loop body} \tn % Row Count 20 (+ 1) % Row 37 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{for ((counter=1; counter -le 10; counter++)) - Loops 10 times} \tn % Row Count 22 (+ 2) % Row 38 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{\$\{array{[}I{]}\}}} - Indexes array} \tn % Row Count 23 (+ 1) % Row 39 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{\$\{array{[}}}{]}\}{\emph{ - References the whole array. Can also use }}@*} \tn % Row Count 25 (+ 2) % Row 40 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{declare -A array}} - declares associative array} \tn % Row Count 26 (+ 1) % Row 41 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{myassocarray=({[}apple{]}="red" {[}banana{]}="yellow") - Creates associative array} \tn % Row Count 28 (+ 2) % Row 42 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{\$\{myassocarray{[}banana{]}\}}} - References bananas value in the array} \tn % Row Count 30 (+ 2) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Scripting (cont)}} \tn % Row 43 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{unset array{[}I{]}}} - Deletes the I index} \tn % Row Count 1 (+ 1) % Row 44 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{unset array}} - Deletes the array} \tn % Row Count 2 (+ 1) % Row 45 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{\$\{\#array\}}} - Outputs the length of the array} \tn % Row Count 3 (+ 1) % Row 46 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{alias ll = 'ls -l'}} - Creates the ll command as an alias} \tn % Row Count 5 (+ 2) % Row 47 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{home() \{ do stuff ; \}}} Creates the home function} \tn % Row Count 6 (+ 1) % Row 48 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{return}} - defaults to the previous exit value} \tn % Row Count 7 (+ 1) % Row 49 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{local}} - Creates local variable within function} \tn % Row Count 8 (+ 1) % Row 50 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{cut}} - Cuts away parts of the output} \tn % Row Count 9 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{GitHub}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{git clone \textless{}url\textgreater{}}} - Clones gitkeeper url} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{git add \textless{}filename\textgreater{}}} - Adds the file to git} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{git commit}} - Commits all files to git} \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{git push}} - Pushes all git files to host} \tn % Row Count 4 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Package / Networking}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{dnf upgrade}} - Updates system packages} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{dnf install}} - Installs package} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{dnf search}} - Searches for package} \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{dnf remove}} - Removes package} \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{systemctl start}} - Starts systemd service} \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{systemctl stop}} - Stops systemd service} \tn % Row Count 6 (+ 1) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{systemctl restart}} - Restarts systemd service} \tn % Row Count 7 (+ 1) % Row 7 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{systemctl reload}} - Reloads systemd service configuration files} \tn % Row Count 9 (+ 2) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{systemctl enable}} - Enable systemd service at boot} \tn % Row Count 11 (+ 2) % Row 9 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{systemctl disable}} - Disable systemd service} \tn % Row Count 12 (+ 1) % Row 10 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{systemctl status}} - Displays activity state and some log lines of service} \tn % Row Count 14 (+ 2) % Row 11 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{atq}} - Displays currently scheduled commands} \tn % Row Count 15 (+ 1) % Row 12 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{at}} - Runs command once at certain time/day} \tn % Row Count 16 (+ 1) % Row 13 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{atrm}} - Remove scheduled commands} \tn % Row Count 17 (+ 1) % Row 14 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{crontab -e}} - Create a file for scheduled commands to run} \tn % Row Count 19 (+ 2) % Row 15 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{journalctl}} - Shows logs} \tn % Row Count 20 (+ 1) % Row 16 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{dmesg}} - Shows kernel messages, hardware, driver, etc.} \tn % Row Count 22 (+ 2) % Row 17 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{history}} - Shows previous commands} \tn % Row Count 23 (+ 1) % Row 18 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{script}} - Records all input and writes it to a file} \tn % Row Count 25 (+ 2) % Row 19 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{route}} - Configures IP connection} \tn % Row Count 26 (+ 1) % Row 20 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{hostname}} - Sets system host name} \tn % Row Count 27 (+ 1) % Row 21 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{netstat -rn}} - Gives routing table} \tn % Row Count 28 (+ 1) % Row 22 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{ifconfig}} - Outputs network interface} \tn % Row Count 29 (+ 1) % Row 23 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{ip addr}} - Shows different addresses and internet connections} \tn % Row Count 31 (+ 2) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Package / Networking (cont)}} \tn % Row 24 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{traceroute -I}} - Gives list of IPs the machine went through} \tn % Row Count 2 (+ 2) % Row 25 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{wget}} - Downloads file from internet} \tn % Row Count 3 (+ 1) % Row 26 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{brctl, nmcli}} - Creates bridging between ports} \tn % Row Count 4 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Other Stuff}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{Ctrl - U}} - Deletes command line} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{Ctrl - C}} - Aborts command} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{Ctrl - Z}} - Suspends command} \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{fg}} - Resumes command after suspension} \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{Ctrl - T}} - Fix misspelled command} \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{cal}} - Prints ASCII calendar} \tn % Row Count 6 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{System Information}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{free}} - Displays amount of free and used memory in system} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{df}} - Reports file system disk space usage} \tn % Row Count 3 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{lsblk}} - Reports information about block devices} \tn % Row Count 4 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{fdisk}} - Manipulates disk partition table} \tn % Row Count 5 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{Uname}} - Prints system information} \tn % Row Count 6 (+ 1) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{top}} - Display and update sorted info about processes} \tn % Row Count 8 (+ 2) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{uptime}} - Displays the amount of timed the machine has been running} \tn % Row Count 10 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{User/Root Commands}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{useradd}} - Creates new user} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{passwd}} - Sets password for new user} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{userdel}} - Removes user} \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{chsh -{}-shell /bin/sh username}} - Changes shell} \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{sudo grouped groupante}} - Creates group} \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{chown}} - Changes owner} \tn % Row Count 6 (+ 1) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{chgrp}} - Changes group} \tn % Row Count 7 (+ 1) % Row 7 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{chmod}} - Changes permissions} \tn % Row Count 8 (+ 1) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{chmod ug +x filename}} - Gives user and group permission to execute file} \tn % Row Count 10 (+ 2) % Row 9 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{chmod 1777 filename}} - Sets all permissions and a sticky bit} \tn % Row Count 12 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Samba}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{smbpasswd}} - Sets server password} \tn % Row Count 1 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{File and Directory Manipulation}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{ls}} - Shows all files in current directory} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{ls -a}} - Shows all files including hidden files in current directory} \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{pwd}} - Shows current directory (present working directory)} \tn % Row Count 5 (+ 2) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{cd}} - Changes curent directory} \tn % Row Count 6 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{pstree}} - Shows running processes as a tree} \tn % Row Count 7 (+ 1) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{ps}} - Report a snapshot of current processes} \tn % Row Count 8 (+ 1) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{cp}} - Copies files} \tn % Row Count 9 (+ 1) % Row 7 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{cp filename newfilename}} - Creates new file with old file information} \tn % Row Count 11 (+ 2) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{cp filename directory/}} - Puts file into directory} \tn % Row Count 13 (+ 2) % Row 9 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{mv}} - Moves files} \tn % Row Count 14 (+ 1) % Row 10 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{mv filename directory/}} - Moves file into directory} \tn % Row Count 16 (+ 2) % Row 11 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{rm}} - Removes\textbackslash{}deletes files} \tn % Row Count 17 (+ 1) % Row 12 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{rm -r}} - Deletes directories} \tn % Row Count 18 (+ 1) % Row 13 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{rm -r directory/}} - Removes directory} \tn % Row Count 19 (+ 1) % Row 14 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{rm -rf directory/}} - Removes directory to oblivion} \tn % Row Count 21 (+ 2) % Row 15 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{mkdir}} - Creates directories} \tn % Row Count 22 (+ 1) % Row 16 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{echo}} - Moves data (e.g. moves text into a file)} \tn % Row Count 23 (+ 1) % Row 17 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{echo text \textgreater{}\textgreater{} filename}} - Moves text into file} \tn % Row Count 24 (+ 1) % Row 18 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{cat}} - Reads file text or concatenate files and print file text} \tn % Row Count 26 (+ 2) % Row 19 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{touch}} - Creates any kind of file} \tn % Row Count 27 (+ 1) % Row 20 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{tail}} - Outputs last part of files} \tn % Row Count 28 (+ 1) % Row 21 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{less}} - Views files instead of opening them. Lets user scroll through} \tn % Row Count 30 (+ 2) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{File and Directory Manipulation (cont)}} \tn % Row 22 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{awk}} - Selects data and presents rows and columns in output} \tn % Row Count 2 (+ 2) % Row 23 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{awk '\{print \$1,\$2,\$3\}' filename}} - Prints first, second, third words of each line} \tn % Row Count 4 (+ 2) % Row 24 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{sort}} - Sorts lines of text files} \tn % Row Count 5 (+ 1) % Row 25 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{vi filename}} - Opens text editor for file. Hard to use} \tn % Row Count 7 (+ 2) % Row 26 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{file filename}} - Gives information on file} \tn % Row Count 8 (+ 1) % Row 27 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{more filename}} - Displays file contents (no scrolling)} \tn % Row Count 10 (+ 2) % Row 28 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{grep "text" filename}} - Searches for text within file} \tn % Row Count 12 (+ 2) % Row 29 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{find}} - Finds files} \tn % Row Count 13 (+ 1) % Row 30 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{whoami}} - Prints current user} \tn % Row Count 14 (+ 1) % Row 31 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{rmdir}} - Removes directories} \tn % Row Count 15 (+ 1) % Row 32 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{du}} - Displays file space usage} \tn % Row Count 16 (+ 1) % Row 33 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\emph{yes}} - Displays the same line of text until interrupted} \tn % Row Count 18 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}