\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{cerr221} \pdfinfo{ /Title (linux1.pdf) /Creator (Cheatography) /Author (cerr221) /Subject (Linux1 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}{A3A3A3} \definecolor{LightBackground}{HTML}{F3F3F3} \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{Linux1 Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{cerr221} via \textcolor{DarkBackground}{\uline{cheatography.com/69679/cs/17654/}}} \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}cerr221 \\ \uline{cheatography.com/cerr221} \\ \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 26th October, 2018.\\ 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{2.8 cm} x{5.2 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Common}} \tn % Row 0 \SetRowColor{LightBackground} pwd & pinrt current working dir \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} cd & change directory \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} cd ../ & change directory up 1 \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} cd \textasciitilde{}/ & change dir to home. \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} ls & list content of directory \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} ls -l & detailed list \tn % Row Count 6 (+ 1) % Row 6 \SetRowColor{LightBackground} ls -h & readable byte format \tn % Row Count 7 (+ 1) % Row 7 \SetRowColor{white} ls -F & list all files + extension attributes \tn % Row Count 9 (+ 2) % Row 8 \SetRowColor{LightBackground} ls -lF & list files, ext, attrib, size, etc -\textgreater{} more detailed \tn % Row Count 11 (+ 2) % Row 9 \SetRowColor{white} tree & list directory in a tree like format \tn % Row Count 13 (+ 2) % Row 10 \SetRowColor{LightBackground} file & file command displays type of any file \tn % Row Count 15 (+ 2) % Row 11 \SetRowColor{white} file Desktop & will return Desktop: Directory \tn % Row Count 17 (+ 2) % Row 12 \SetRowColor{LightBackground} alias & to list all current alias for system/user \tn % Row Count 19 (+ 2) % Row 13 \SetRowColor{white} alias \seqsplit{LC="newFunction"} & creates a new alias "LC" that does "newFunction" \tn % Row Count 21 (+ 2) % Row 14 \SetRowColor{LightBackground} man & man pages \tn % Row Count 22 (+ 1) % Row 15 \SetRowColor{white} man -k & very similar to apropos \tn % Row Count 23 (+ 1) % Row 16 \SetRowColor{LightBackground} apropos & list all available man pages for specific word \tn % Row Count 25 (+ 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}{Text + Redirection Examples}} \tn % Row 0 \SetRowColor{LightBackground} echo "string" & sends string to stdout (terminal) \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} echo "string" \textgreater{} file1.txt & sends string to file1.txt (redirection) \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} echo -e "string \textbackslash{}tNewString" & -e = enables extra character (?) use. \textbackslash{}t option is for tab -\textgreater{} writes NewStringAfterTab after a tab, not space! \tn % Row Count 9 (+ 5) % Row 3 \SetRowColor{white} echo -e "string \textbackslash{}nNewString" & same as above but writes newstring after newline instead of tab. \tn % Row Count 12 (+ 3) % Row 4 \SetRowColor{LightBackground} cat & reads content of txt file and sends it to stdout (terminal) \tn % Row Count 15 (+ 3) % Row 5 \SetRowColor{white} cat \textgreater{} file.txt & with redirection before any file is mentioned -\textgreater{} will allow you to enter text at Terminal screen until Ctrl+d command (end) and sends it to file.txt \tn % Row Count 22 (+ 7) % Row 6 \SetRowColor{LightBackground} cat \textless{}\textless{}exit\textgreater{} & same as above but need to type exit as end command instead of Ctrl+d \tn % Row Count 25 (+ 3) % Row 7 \SetRowColor{white} cat file1.txt \textgreater{} file2.txt & reads content from file1.txt, sends it to file2.txt AND replaces any content! \tn % Row Count 29 (+ 4) % Row 8 \SetRowColor{LightBackground} cat file1.txt \textgreater{}\textgreater{} file2.txt & appends content of file1.txt to end of file2.txt \tn % Row Count 32 (+ 3) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{3.28 cm} x{4.72 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Text + Redirection Examples (cont)}} \tn % Row 9 \SetRowColor{LightBackground} tac & same as cat but reads file in reverse! \tn % Row Count 2 (+ 2) % Row 10 \SetRowColor{white} head & show first 10 line of a file \tn % Row Count 4 (+ 2) % Row 11 \SetRowColor{LightBackground} head -n (X) & show the first X lines of a file \tn % Row Count 6 (+ 2) % Row 12 \SetRowColor{white} tail & show last 10 lines of text file \tn % Row Count 8 (+ 2) % Row 13 \SetRowColor{LightBackground} tail -n (X) & show last X lines of text file \tn % Row Count 10 (+ 2) % Row 14 \SetRowColor{white} more & displays first page of file \tn % Row Count 12 (+ 2) % Row 15 \SetRowColor{LightBackground} less & displays the last page of a file and allows to move through pages with enter + spacebar \tn % Row Count 16 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{1.216 cm} x{5.32 cm} x{1.064 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{8.4cm}}{\bf\textcolor{white}{Wildcards}} \tn % Row 0 \SetRowColor{LightBackground} * & Matches 0 or more occurrences of the previous character & \seqsplit{Common} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} ? & matches 0 or 1 occurrences of the previous char & \seqsplit{Extended} \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} + & matches 1 or more occurrences of prev char & \seqsplit{Extended} \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} . & Matches 1 character of any type & \seqsplit{Common} \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} {[}...{]} & Matches 1 character from the specified range & \seqsplit{Common} \tn % Row Count 10 (+ 2) % Row 5 \SetRowColor{white} {[}\textasciicircum{}...{]} & Matches 1 character NOT from the range specified within braces & \seqsplit{Common} \tn % Row Count 13 (+ 3) % Row 6 \SetRowColor{LightBackground} \{ \} & Matches a specific number or range of the prev char & \seqsplit{Extended} \tn % Row Count 15 (+ 2) % Row 7 \SetRowColor{white} \textasciicircum{} & Marches the following characters if they are the first characters on the line & \seqsplit{Common} \tn % Row Count 18 (+ 3) % Row 8 \SetRowColor{LightBackground} \$ & Matches the previous characters if they are the last char on the line & \seqsplit{Common} \tn % Row Count 21 (+ 3) % Row 9 \SetRowColor{white} \seqsplit{(...|...)} & Matches either of two sets of characters & \seqsplit{Extended} \tn % Row Count 23 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{2.08 cm} x{5.92 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{misc}} \tn % Row 0 \SetRowColor{LightBackground} echo \$PATH & see the content of the \$PATH variable currently loaded in memory \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} which "grep" & to search directories of the PATH variable for a file called grep. \tn % Row Count 6 (+ 3) % Row 2 \SetRowColor{LightBackground} ln (link) & command to hard-link files \tn % Row Count 7 (+ 1) % Row 3 \SetRowColor{white} ln -s & command to create a symbolic link between 2 files \tn % Row Count 9 (+ 2) % Row 4 \SetRowColor{LightBackground} whoami & find out which user you are logged on as \tn % Row Count 11 (+ 2) % Row 5 \SetRowColor{white} groups & lists groups for current user unless we specify a user \tn % Row Count 13 (+ 2) % Row 6 \SetRowColor{LightBackground} cat \seqsplit{/etc/group} & to list all groups that exists on the current system \tn % Row Count 15 (+ 2) % Row 7 \SetRowColor{white} chown & change user \tn % Row Count 16 (+ 1) % Row 8 \SetRowColor{LightBackground} chown -R & change owner/permissions recursively (-R) \tn % Row Count 18 (+ 2) % Row 9 \SetRowColor{white} chgrp & change group command \tn % Row Count 19 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{2.16 cm} x{5.84 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Permissions}} \tn % Row 0 \SetRowColor{LightBackground} chown & change owner \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} chgrp & change group \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} chmod & change mode of file (permissions \tn % Row Count 4 (+ 2) % Row 3 \SetRowColor{white} u & user \tn % Row Count 5 (+ 1) % Row 4 \SetRowColor{LightBackground} g & group \tn % Row Count 6 (+ 1) % Row 5 \SetRowColor{white} o & other \tn % Row Count 7 (+ 1) % Row 6 \SetRowColor{LightBackground} a & All categories \tn % Row Count 8 (+ 1) % Row 7 \SetRowColor{white} + & adds a permission \tn % Row Count 9 (+ 1) % Row 8 \SetRowColor{LightBackground} - & removes a permission \tn % Row Count 10 (+ 1) % Row 9 \SetRowColor{white} = & makes a permission equal to \tn % Row Count 11 (+ 1) % Row 10 \SetRowColor{LightBackground} chmod u+w file1 & change user permissions to write for file1 \tn % Row Count 13 (+ 2) % Row 11 \SetRowColor{white} rwx & 4+2+1 = 7 \tn % Row Count 14 (+ 1) % Row 12 \SetRowColor{LightBackground} rw- & 4+2 = 6 \tn % Row Count 15 (+ 1) % Row 13 \SetRowColor{white} r-x & 4+1 = 5 \tn % Row Count 16 (+ 1) % Row 14 \SetRowColor{LightBackground} r-{}- & 4 \tn % Row Count 17 (+ 1) % Row 15 \SetRowColor{white} -wx & 2+1 = 3 \tn % Row Count 18 (+ 1) % Row 16 \SetRowColor{LightBackground} -w- & 2 \tn % Row Count 19 (+ 1) % Row 17 \SetRowColor{white} -{}-x & 1 \tn % Row Count 20 (+ 1) % Row 18 \SetRowColor{LightBackground} -{}-{}- & 0 \tn % Row Count 21 (+ 1) \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}{Compression + Exatraction}} \tn % Row 0 \SetRowColor{LightBackground} compress -v file1 file2 & compresses file1 into file1.z and file2 into file2.z \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} zcat \seqsplit{compressedfile1}.z & command to display contents of a compressed file \tn % Row Count 5 (+ 2) % Row 2 \SetRowColor{LightBackground} uncompress -v & command to uncompress the file \tn % Row Count 7 (+ 2) % Row 3 \SetRowColor{white} gzip -v file1 & compresses fil1 with gzip utility (better compression ratio) to file1.gz \tn % Row Count 10 (+ 3) % Row 4 \SetRowColor{LightBackground} gunzip -v file1.gz & to decrompress a .gz file \tn % Row Count 12 (+ 2) % Row 5 \SetRowColor{white} bzip2 -v file1 & compress file1 using bzip2 utility to file1.bz2 \tn % Row Count 14 (+ 2) % Row 6 \SetRowColor{LightBackground} bunzip2 -v file1.bz2 & uncompress command \tn % Row Count 16 (+ 2) % Row 7 \SetRowColor{white} tar & tape archive utility. Used for backups and compression! \tn % Row Count 19 (+ 3) % Row 8 \SetRowColor{LightBackground} tar -cvf /backup.tar * & command to create an archive called backup.tar that contains the contents of the current directory \tn % Row Count 24 (+ 5) % Row 9 \SetRowColor{white} tar -tvf /backup.tar & command to view the contents of an archive \tn % Row Count 26 (+ 2) % Row 10 \SetRowColor{LightBackground} tar -xvf /backup.tar & extract the contents of the archive to our current directory \tn % Row Count 29 (+ 3) % Row 11 \SetRowColor{white} tar -zcvf \seqsplit{/backup.tar.gz*} & creates a gzip-compressed archive called /backup.tar.gz that contains the contents of the current directory \tn % Row Count 34 (+ 5) \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}{Compression + Exatraction (cont)}} \tn % Row 12 \SetRowColor{LightBackground} tar -ztvf /backup.tar.gz & to view the contents of a gzip-compressed archive \tn % Row Count 3 (+ 3) % Row 13 \SetRowColor{white} tar -zxvf /backup.tar.gz & to extract contents of a gzip-compressed archive \tn % Row Count 5 (+ 2) % Row 14 \SetRowColor{LightBackground} cpio & similar to tar utility \tn % Row Count 6 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{3.2 cm} x{4.8 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Directory + files}} \tn % Row 0 \SetRowColor{LightBackground} mkdir & make directory \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} rmdir & remove directory -\textgreater{} unlike rm -rf \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} touch & can be used to create file.txt \tn % Row Count 5 (+ 2) % Row 3 \SetRowColor{white} rm & remove file \tn % Row Count 6 (+ 1) % Row 4 \SetRowColor{LightBackground} rm -rf & DELETE ALL! -\textgreater{} remove files recursively and force it \tn % Row Count 9 (+ 3) % Row 5 \SetRowColor{white} rm -i & -i ooption to prompt for removal before deletion \tn % Row Count 11 (+ 2) % Row 6 \SetRowColor{LightBackground} mv file1.txt Newfile.txt & Ironically -\textgreater{} command to rename files. Rename file1.txt to Newfile.txt \tn % Row Count 14 (+ 3) % Row 7 \SetRowColor{white} cp /dir/file1 /newdir/file1 & copy command to copy file1 from dir to newdir \tn % Row Count 16 (+ 2) \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}{File search + Manipulation}} \tn % Row 0 \SetRowColor{LightBackground} find & find for files in a directory hierarchy \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} locate & find files by name \tn % Row Count 3 (+ 1) % Row 2 \SetRowColor{LightBackground} cut & with options -\textgreater{} can cut out sections and fields of a text file and send it to stdout \tn % Row Count 7 (+ 4) % Row 3 \SetRowColor{white} cut -d ' ' -f (X) & -d = delimiter option. Anything that seperates the first field by the delimiter will be counter as 2...3...4...5 in field. -f = field option. \tn % Row Count 14 (+ 7) % Row 4 \SetRowColor{LightBackground} date & sends out the current date to stdout. Useful with redirections \tn % Row Count 17 (+ 3) % Row 5 \SetRowColor{white} grep string file.txt & look for anything that contains string in file.txt \tn % Row Count 20 (+ 3) % Row 6 \SetRowColor{LightBackground} grep -i string & return any hit that matches string exactly \tn % Row Count 22 (+ 2) % Row 7 \SetRowColor{white} grep -i string & Can also be used to exclude case sensitiveness \tn % Row Count 25 (+ 3) % Row 8 \SetRowColor{LightBackground} grep -r string & -r = looks for string recursively down all files in the current directory tree. \tn % Row Count 29 (+ 4) % Row 9 \SetRowColor{white} grep -c 'string' Test.txt & Returns the numbers of instances of string in Test.txt. Similar to wc (word count) command \tn % Row Count 34 (+ 5) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{3.52 cm} x{4.48 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{File search + Manipulation (cont)}} \tn % Row 10 \SetRowColor{LightBackground} grep -v string text1.txt & -v option -\textgreater{} return lines that do not contain string \tn % Row Count 3 (+ 3) % Row 11 \SetRowColor{white} grep -e & extended grep - same as egrep \tn % Row Count 5 (+ 2) % Row 12 \SetRowColor{LightBackground} egrep & extended grep \tn % Row Count 6 (+ 1) % Row 13 \SetRowColor{white} egrep "(lodge|lake)" text1.txt & View lines that contain either lodge of lake. \tn % Row Count 9 (+ 3) % Row 14 \SetRowColor{LightBackground} sed & stream editor -\textgreater{} can be used instead of cut \& to search + replace. \tn % Row Count 12 (+ 3) % Row 15 \SetRowColor{white} sed -i -e 's/few/asd/g' Test.txt & replace all instances of few in the file Test.txt with 'asd'. Find and replace command \tn % Row Count 16 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{2.32 cm} x{5.68 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Vi Commands}} \tn % Row 0 \SetRowColor{LightBackground} vi text.txt & opens text.txt in VI editor \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} i & enter insert mode \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} a & Changes to insert mode \& places cursor after the current character to enter text \tn % Row Count 5 (+ 3) % Row 3 \SetRowColor{white} o & Change to insert and opens new line beneath current \tn % Row Count 7 (+ 2) % Row 4 \SetRowColor{LightBackground} I & changes to insert mode and places cursor at start of current line \tn % Row Count 10 (+ 3) % Row 5 \SetRowColor{white} A & Changes to insert mode and places cursor at end of line \tn % Row Count 12 (+ 2) % Row 6 \SetRowColor{LightBackground} Escape & leave insert mode \tn % Row Count 13 (+ 1) % Row 7 \SetRowColor{white} \$ & go to end of line in reg mode \tn % Row Count 15 (+ 2) % Row 8 \SetRowColor{LightBackground} :wq & save and exit \tn % Row Count 16 (+ 1) % Row 9 \SetRowColor{white} :q! & exit and do not save \tn % Row Count 17 (+ 1) % Row 10 \SetRowColor{LightBackground} \seqsplit{ctrl+shift+v} & paste keyboard shortcuts \tn % Row Count 19 (+ 2) % Row 11 \SetRowColor{white} G & move the cursor to last line of document \tn % Row Count 21 (+ 2) % Row 12 \SetRowColor{LightBackground} x & deletes character cursor is on \tn % Row Count 23 (+ 2) % Row 13 \SetRowColor{white} d\$ & deletes the cursor character to the end of the line \tn % Row Count 25 (+ 2) % Row 14 \SetRowColor{LightBackground} u & undo the last function \tn % Row Count 26 (+ 1) % Row 15 \SetRowColor{white} . & repeats the last function \tn % Row Count 27 (+ 1) % Row 16 \SetRowColor{LightBackground} y\$ & Copies the current line into a temporary buffer in memory for later use \tn % Row Count 30 (+ 3) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{2.32 cm} x{5.68 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Vi Commands (cont)}} \tn % Row 17 \SetRowColor{LightBackground} p & Pastes the content underneath current line or after current word \tn % Row Count 3 (+ 3) % Row 18 \SetRowColor{white} P & Pastes content above current line or after current word \tn % Row Count 5 (+ 2) % Row 19 \SetRowColor{LightBackground} w filename & Saves the current document to file named filename \tn % Row Count 7 (+ 2) % Row 20 \SetRowColor{white} :r !date & reads output of date command into document under the current line \tn % Row Count 10 (+ 3) % Row 21 \SetRowColor{LightBackground} :set all & displays all vi environment settings \tn % Row Count 12 (+ 2) % Row 22 \SetRowColor{white} \seqsplit{:s/the/THE/g} & searches for reg expression "the" and replaces each occurence globally throughout the current line with the word "THE" \tn % Row Count 17 (+ 5) % Row 23 \SetRowColor{LightBackground} :1,\$ \seqsplit{s/the/THE/g} & same as above but does this globally from line 1 to the end of the document \tn % Row Count 20 (+ 3) \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}{filesystem}} \tn % Row 0 \SetRowColor{LightBackground} cat /dev/proc & show all devices currently used by the system \& it's major number \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} mount & mount command \tn % Row Count 4 (+ 1) % Row 2 \SetRowColor{LightBackground} mount -t & to specify which filesystem to be mounted use -t option \tn % Row Count 7 (+ 3) % Row 3 \SetRowColor{white} umount & unmount command \tn % Row Count 8 (+ 1) % Row 4 \SetRowColor{LightBackground} mkfs & make filesystem command \tn % Row Count 9 (+ 1) % Row 5 \SetRowColor{white} mkfs -t ext & use -t command + filesystem chosen to specify filesystem to be used \tn % Row Count 12 (+ 3) % Row 6 \SetRowColor{LightBackground} mke2fs & make ext2 file system. \tn % Row Count 13 (+ 1) % Row 7 \SetRowColor{white} fuser -u & to check if a directory or device is currently used by a user \tn % Row Count 16 (+ 3) % Row 8 \SetRowColor{LightBackground} cat /etc/fstab & list contents of fstab file which is file to edit to add devices to auto-mount at boot. \tn % Row Count 20 (+ 4) % Row 9 \SetRowColor{white} mkisofs & make iso image command \tn % Row Count 21 (+ 1) % Row 10 \SetRowColor{LightBackground} fdisk & partitioning utility \tn % Row Count 22 (+ 1) % Row 11 \SetRowColor{white} cdisk & Same as fdisk but with GUI \tn % Row Count 24 (+ 2) % Row 12 \SetRowColor{LightBackground} pvcreate /dev/sda4 & creates physical volume \tn % Row Count 26 (+ 2) % Row 13 \SetRowColor{white} vgcreate vg00 /dev/sda4 & create volume group \tn % Row Count 28 (+ 2) % Row 14 \SetRowColor{LightBackground} lvcreate -L 5GB -n Data vg00 & create logical volume named Data that's 5GB in size. \tn % Row Count 31 (+ 3) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{3.28 cm} x{4.72 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{filesystem (cont)}} \tn % Row 15 \SetRowColor{LightBackground} df & disk free space command (shows free space on all mounted filesystems) \tn % Row Count 3 (+ 3) % Row 16 \SetRowColor{white} df -h & readable format \tn % Row Count 4 (+ 1) % Row 17 \SetRowColor{LightBackground} du & directory usage -\textgreater{} useful to know which directory is using up the most space \tn % Row Count 8 (+ 4) % Row 18 \SetRowColor{white} fsck & filesystemcheck \tn % Row Count 9 (+ 1) % Row 19 \SetRowColor{LightBackground} lsblk & list block devices (including Partitions) \tn % Row Count 11 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}