\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{Victor M. (torvic98)} \pdfinfo{ /Title (administracion-de-sistemas.pdf) /Creator (Cheatography) /Author (Victor M. (torvic98)) /Subject (Administración de sistemas 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}{25BFA1} \definecolor{LightBackground}{HTML}{F1FBF9} \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{Administración de sistemas Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{Victor M. (torvic98)} via \textcolor{DarkBackground}{\uline{cheatography.com/56260/cs/14918/}}} \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}Victor M. (torvic98) \\ \uline{cheatography.com/torvic98} \\ \uline{\seqsplit{www}.xdevelop.ml} \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 June, 2018.\\ Updated 18th June, 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*}{3} \begin{tabularx}{5.377cm}{p{0.4977 cm} x{4.4793 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Sections of man pages}} \tn % Row 0 \SetRowColor{LightBackground} 1 & User-level commands and applications \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} 2 & System calls and kernel error codes \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} 3 & Library calls \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} 4 & Device drivers and network protocols \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} 5 & Standard file formats \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} 6 & Games and demonstrations \tn % Row Count 6 (+ 1) % Row 6 \SetRowColor{LightBackground} 7 & Miscellaneous files and documents \tn % Row Count 7 (+ 1) % Row 7 \SetRowColor{white} 8 & System administration commands \tn % Row Count 8 (+ 1) % Row 8 \SetRowColor{LightBackground} 9 & Obscure kernel specs and interfaces \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}{Substitution order}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{1. Redirect I/O} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{2. Replace \{\} expansion} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{3. Replace \textbackslash{}`\textasciitilde{}\textbackslash{}` expansion} \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{4. Params and variable expansion} \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{5. Commnad \$() substitution} \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{6. Arithmetic expansion} \tn % Row Count 6 (+ 1) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{7. Process \textless{}() substitution} \tn % Row Count 7 (+ 1) % Row 7 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{8. Word splitting (IFS)} \tn % Row Count 8 (+ 1) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{9. File name expansion} \tn % Row Count 9 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.84149 cm} x{3.13551 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{wget(1)}} \tn % Row 0 \SetRowColor{LightBackground} `-q, -{}-quiet` & Turns off Wget's output \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} `-B, -{}-base` & Relative links using URL \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} `-t, -{}-tries` & Set number of retries \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} `-O \{{\emph{file}}|-\}` & Redirect output \tn % Row Count 5 (+ 2) % Row 4 \SetRowColor{LightBackground} `-T, -{}-timeout` & Network timeout to seconds \tn % Row Count 7 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.4931 cm} x{3.4839 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{date(1)}} \tn % Row 0 \SetRowColor{LightBackground} `-d, -{}-date=` & Display time described, not now \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} `-s, -{}-set=` & Set time to described ¡ \tn % Row Count 3 (+ 1) % Row 2 \SetRowColor{LightBackground} `\%a, \%A` & Sun, Sunday \tn % Row Count 4 (+ 1) % Row 3 \SetRowColor{white} `\%b, \%B` & Jan, January \tn % Row Count 5 (+ 1) % Row 4 \SetRowColor{LightBackground} `\%c` & Thu Mar 3 23:05:25 2005 \tn % Row Count 6 (+ 1) % Row 5 \SetRowColor{white} `\%d` & day of month \tn % Row Count 7 (+ 1) % Row 6 \SetRowColor{LightBackground} `\%F` & full date; same as `\%Y-\%m-\%d` \tn % Row Count 9 (+ 2) % Row 7 \SetRowColor{white} `\%H, \%I` & hour (00..23), hour (01..12) \tn % Row Count 10 (+ 1) % Row 8 \SetRowColor{LightBackground} `\%m` & month (01..12) \tn % Row Count 11 (+ 1) % Row 9 \SetRowColor{white} `\%M` & minute (00..59) \tn % Row Count 12 (+ 1) % Row 10 \SetRowColor{LightBackground} `\%s` & seconds since epoch \tn % Row Count 13 (+ 1) % Row 11 \SetRowColor{white} `\%S` & second (00..60) \tn % Row Count 14 (+ 1) % Row 12 \SetRowColor{LightBackground} `\%T` & time; same as `\%H:\%M:\%S` \tn % Row Count 15 (+ 1) % Row 13 \SetRowColor{white} `\%Y` & Year \tn % Row Count 16 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.04057 cm} x{2.93643 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{tar(1)}} \tn % Row 0 \SetRowColor{LightBackground} `-c, -{}-create` & create new \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} `-r, -{}-append` & append files \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} `-t, -{}-list` & list the contents \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} `-u, -{}-update` & only append newer \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} `-x, -{}-extract` & extract files \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} `-C, -{}-directory=` & change to directory \tn % Row Count 7 (+ 2) % Row 6 \SetRowColor{LightBackground} `-f, -{}-file=` & use archive file or device \tn % Row Count 9 (+ 2) % Row 7 \SetRowColor{white} `-j, -{}-bzip2` & bzip2 \tn % Row Count 10 (+ 1) % Row 8 \SetRowColor{LightBackground} `-z, -{}-gzip` & gzip \tn % Row Count 11 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.54747 cm} x{4.42953 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{sort(1)}} \tn % Row 0 \SetRowColor{LightBackground} `-b` & ignore leading blanks \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} `-d` & only blanks and alphanumeric \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} `-f` & case insensitive \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} `-i` & ignore non-printable \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} `-M` & compare 3-letter month \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} `-h` & human numeric (2K \textless{} 1G) \tn % Row Count 6 (+ 1) % Row 6 \SetRowColor{LightBackground} `-n` & numeric \tn % Row Count 7 (+ 1) % Row 7 \SetRowColor{white} `-R` & random short (hash) \tn % Row Count 8 (+ 1) % Row 8 \SetRowColor{LightBackground} `-r` & reverse result, i. e. descending \tn % Row Count 9 (+ 1) % Row 9 \SetRowColor{white} `-k` & Key start at pos (origin 1) \tn % Row Count 10 (+ 1) % Row 10 \SetRowColor{LightBackground} `-u` & Delete duplicates \tn % Row Count 11 (+ 1) % Row 11 \SetRowColor{white} `-z` & Zero terminated lines \tn % Row Count 12 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.59264 cm} x{3.38436 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{read(1)}} \tn % Row 0 \SetRowColor{LightBackground} `-p {\emph{prompt}}` & Shows prompt text \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} `-r` & One line only (no backslash) \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} `-s` & Silent. No echo. \tn % Row Count 5 (+ 1) % Row 3 \SetRowColor{white} `-t` & Timeout in seconds \tn % Row Count 6 (+ 1) % Row 4 \SetRowColor{LightBackground} `-u {\emph{fd}}` & Read from file descriptor \tn % Row Count 7 (+ 1) % Row 5 \SetRowColor{white} `-n` & Number of chars \tn % Row Count 8 (+ 1) % Row 6 \SetRowColor{LightBackground} `-d` & Set delimiter \tn % Row Count 9 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.79172 cm} x{3.18528 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{du(1)}} \tn % Row 0 \SetRowColor{LightBackground} `-a` & All files (not just dirs) \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} `-{}-files0-from=` & Null separated. '-' is stdin \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} `-h` & Human readable \tn % Row Count 4 (+ 1) % Row 3 \SetRowColor{white} `-{}-max-depth` & '0' =\textgreater{} just given argument \tn % Row Count 6 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.39356 cm} x{3.58344 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{lvm(8) - pv / vg / lv}} \tn % Row 0 \SetRowColor{LightBackground} \textasciitilde{}change & Change attributes \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \textasciitilde{}create & Initialize for use by LVM. \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \textasciitilde{}display & Display attributes \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} \textasciitilde{}resize & Resize a LVM \textasciitilde{} \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} \textasciitilde{}extend -L & Extends \textasciitilde{} by {[}+{]}bytes \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} \textasciitilde{}scan & Shows all LVM \textasciitilde{} \tn % Row Count 6 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{Tips: `mkfs -t ext3 part` / `resize2fs lv\_name`} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{/etc/passwd}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{\seqsplit{login:passwd:UID:GID:info:home:shell}% Row Count 1 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{/etc/shadow}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{\seqsplit{login:passwd:lastchange:mintime:maxtime:warntime:detime:lcktime:}% Row Count 2 (+ 2) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.24425 cm} x{3.73275 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{passwd(1)}} \tn % Row 0 \SetRowColor{LightBackground} `-e` & Expire date \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} `-d` & Delete password \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} `-l, -u` & Lock or unlock \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} `-n` & Min days between changes \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} `-x` & Max days of validity \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} `-w` & Warn days before expire \tn % Row Count 6 (+ 1) % Row 6 \SetRowColor{LightBackground} `-i` & Deactivate days \tn % Row Count 7 (+ 1) % Row 7 \SetRowColor{white} `-S` & Show status of account \tn % Row Count 8 (+ 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}{/etc/group}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{\seqsplit{name:passwd:GID:login-list}% Row Count 1 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{0.84609 cm} x{4.13091 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Shell and tools (I)}} \tn % Row 0 \SetRowColor{LightBackground} type & Shows type of the program or command given as first paramether \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} stty & Change and print terminal line settings \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} \seqsplit{chpasswd} & Reads from stdin pairs of type USER:PASSWORD \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} id & Returns user info `uid=1000(name) gid=1000(name)`. Exit code is set. \tn % Row Count 9 (+ 3) % Row 4 \SetRowColor{LightBackground} bc & Math expresions from stdin. Tip: use `scale=n;` for div precision \tn % Row Count 11 (+ 2) % Row 5 \SetRowColor{white} seq & {\emph{{[}FISR {[}INCREMENT{]}{]} LAST}} \tn % Row Count 12 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{0.96071 cm} x{1.12779 cm} x{1.12779 cm} x{0.96071 cm} } \SetRowColor{DarkBackground} \mymulticolumn{4}{x{5.377cm}}{\bf\textcolor{white}{Shell and tools (II)}} \tn % Row 0 \SetRowColor{LightBackground} cat & who & whoami & head \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} echo & cp & mv & ln \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} mkdir & rm & rmdir & ln -s \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} cat & less & more & bg \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} tee & exec & jobs & fg \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} env & printenv & readonly & export \tn % Row Count 6 (+ 1) % Row 6 \SetRowColor{LightBackground} local & \$(()) & pwd & ls \tn % Row Count 7 (+ 1) % Row 7 \SetRowColor{white} paste & uniq & wc -l & fmt \tn % Row Count 8 (+ 1) % Row 8 \SetRowColor{LightBackground} join & split & tac & rev \tn % Row Count 9 (+ 1) % Row 9 \SetRowColor{white} nl & expand & od & chown \tn % Row Count 10 (+ 1) % Row 10 \SetRowColor{LightBackground} chgrp & chmod & passwd & useradd \tn % Row Count 11 (+ 1) % Row 11 \SetRowColor{white} userdel & usermod & groupadd & \tn % Row Count 12 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}----} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.34379 cm} x{3.63321 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{find(1) {[}OPTIONS{]}}} \tn % Row 0 \SetRowColor{LightBackground} \seqsplit{`-maxdepth`} & Descend at most levels \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \seqsplit{`-mindepth`} & No actions at less than levels \tn % Row Count 4 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.84149 cm} x{3.13551 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{find(1) {[}TESTS{]}}} \tn % Row 0 \SetRowColor{LightBackground} `+n, -n, n` & greater, less, exactly {\emph{n}} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} `-amin n` & Last accessed {\emph{n}} minutes ago \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} `-atime n` & Last accessed {\emph{n}} days ago \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} `-cmin, -ctime n` & Last changed \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} `-mmin, -mtime n` & Last modified \tn % Row Count 10 (+ 2) % Row 5 \SetRowColor{white} `-empty` & Empty regular or directory \tn % Row Count 12 (+ 2) % Row 6 \SetRowColor{LightBackground} `-executable` & File or directory +x \tn % Row Count 13 (+ 1) % Row 7 \SetRowColor{white} `-group {\emph{gname}}` & File belongs to group \tn % Row Count 15 (+ 2) % Row 8 \SetRowColor{LightBackground} `-gid n` & Numeric group ID \tn % Row Count 16 (+ 1) % Row 9 \SetRowColor{white} `-user {\emph{uname}}` & File belongs to user \tn % Row Count 18 (+ 2) % Row 10 \SetRowColor{LightBackground} `-uid n` & Numeric user ID \tn % Row Count 19 (+ 1) % Row 11 \SetRowColor{white} `-name` & Base name matches {\emph{pattern}} \tn % Row Count 21 (+ 2) % Row 12 \SetRowColor{LightBackground} `-iname` & {\emph{-name,}} but case insensitive \tn % Row Count 23 (+ 2) % Row 13 \SetRowColor{white} `-path` & File name matches {\emph{pattern}} \tn % Row Count 25 (+ 2) % Row 14 \SetRowColor{LightBackground} `-perm {\emph{mode}}` & Permission bits are... \tn % Row Count 26 (+ 1) % Row 15 \SetRowColor{white} `g=u, +g=u, /g=u` & exactly, at least, any of \tn % Row Count 28 (+ 2) % Row 16 \SetRowColor{LightBackground} `-size n{[}cwbkMG{]}` & File uses space \tn % Row Count 30 (+ 2) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{1.84149 cm} x{3.13551 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{find(1) {[}TESTS{]} (cont)}} \tn % Row 17 \SetRowColor{LightBackground} `-type {[}bcdpfls{]}` & File is of type \tn % Row Count 2 (+ 2) % Row 18 \SetRowColor{white} `-readable` & With read permission \tn % Row Count 3 (+ 1) % Row 19 \SetRowColor{LightBackground} `-writable` & With write permission \tn % Row Count 4 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.39356 cm} x{3.58344 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{find(1) {[}ACTIONS{]}}} \tn % Row 0 \SetRowColor{LightBackground} `-delete` & Delete files \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} `-exec {\emph{cmd}};` & Execute for every file (multiple \{\}) \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} `-exec {\emph{cmd}}+` & Execute appending file (single \{\}) \tn % Row Count 5 (+ 2) % Row 3 \SetRowColor{white} `-fprint` & Print into file \tn % Row Count 6 (+ 1) % Row 4 \SetRowColor{LightBackground} `-ok {\emph{cmd}} ;` & Like {\emph{-exec,}} but ask user first \tn % Row Count 8 (+ 2) % Row 5 \SetRowColor{white} `-print0` & Null seperated \tn % Row Count 9 (+ 1) % Row 6 \SetRowColor{LightBackground} `-printf` & Print with format \tn % Row Count 10 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.28942 cm} x{2.68758 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{cut(1)}} \tn % Row 0 \SetRowColor{LightBackground} `-b` & Select bytes \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} `-c` & Select characters \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} `-f` & Select fields \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} `-d` & Field delimiter \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} `-{}-complement` & Complement selector \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} `N, N-, N-M, -M` & Specifies selector \tn % Row Count 6 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.89586 cm} x{4.08114 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{ping(8)}} \tn % Row 0 \SetRowColor{LightBackground} `-c` & Number of requests \tn % Row Count 1 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.09494 cm} x{3.88206 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{tail(1)}} \tn % Row 0 \SetRowColor{LightBackground} `-c {\emph{K}}` & Bytes to print \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} `-n {\emph{K}}` & Lines to print \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} `K` & May have sufix (b, kB, K...) \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} `+K` & Print from... \tn % Row Count 4 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.54747 cm} x{4.42953 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{ps(1)}} \tn % Row 0 \SetRowColor{LightBackground} `-e` & All process \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} `-a` & All except leaders and no-terminal \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} `-g` & By group \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} `-p` & By pid \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} `-t` & By tty \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} `-u` & By user \tn % Row Count 6 (+ 1) % Row 6 \SetRowColor{LightBackground} `-F` & Full output format \tn % Row Count 7 (+ 1) % Row 7 \SetRowColor{white} `-o` & Custom output format \tn % Row Count 8 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.74655 cm} x{4.23045 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{wc(1)}} \tn % Row 0 \SetRowColor{LightBackground} `-l` & Number of lines \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} `-w` & Number of words \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} `-c` & Number of bytes \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} `-L` & Length of longest line \tn % Row Count 4 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.09034 cm} x{2.88666 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Predefined variables}} \tn % Row 0 \SetRowColor{LightBackground} \$0 & Program name \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \$1-\$9 & Normal params \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \$\{10\}, \$\{11\}... & More params \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} \$\# & Number of params \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} \$* & List of params \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} \$@ & List of params (*) \tn % Row Count 6 (+ 1) % Row 6 \SetRowColor{LightBackground} \$? & Exit status code \tn % Row Count 7 (+ 1) % Row 7 \SetRowColor{white} \$\$ & Process id \tn % Row Count 8 (+ 1) % Row 8 \SetRowColor{LightBackground} \$! & Last child process id \tn % Row Count 9 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{(*) Use "\$@" when reading in for-loop} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{/etc/sudoers}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{user ALL=ALL \newline % Row Count 1 (+ 1) \%group \seqsplit{ALL=NOPASSWD:/usr/bin/true}% Row Count 2 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Shell and tools (III)}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{if {\emph{cond}}; then \newline {[}elif {\emph{cond}}; then{]} \newline else \newline fi \newline \newline IF=\$' \textbackslash{}t\textbackslash{}n' \newline while {\emph{cond}} \newline do \newline {[}break | continue{]} \newline done \newline \newline until {\emph{cond}} \newline \newline for i in list \newline do \newline done} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{1.87965 cm} p{0.4177 cm} p{0.75186 cm} p{1.12779 cm} } \SetRowColor{DarkBackground} \mymulticolumn{4}{x{5.377cm}}{\bf\textcolor{white}{Shell special characters}} \tn % Row 0 \SetRowColor{LightBackground} ' & " & \textbackslash{} & \& \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \textless{} & \textgreater{} & \textless{}\textless{} & \textgreater{}\textgreater{} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} * & | & ? & {[} {]} \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} {[}!\textasciicircum{} {]} & \$ & ; & ` \tn % Row Count 4 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}----} \SetRowColor{LightBackground} \mymulticolumn{4}{x{5.377cm}}{Between " " only \$, \textbackslash{}`cmd\textbackslash{}` and \textbackslash{}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}----} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{1.50372 cm} p{0.87717 cm} p{1.21133 cm} p{0.58478 cm} } \SetRowColor{DarkBackground} \mymulticolumn{4}{x{5.377cm}}{\bf\textcolor{white}{Extended regex}} \tn % Row 0 \SetRowColor{LightBackground} . & {[} {]} & {[}\textasciicircum{} {]} & \textasciicircum{} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \$ & * & ( ) & \textbackslash{} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \{n,m\} & + & ? & \textbackslash{}w \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} \textbackslash{}s & \textbackslash{}b & \textbackslash{}B & \tn % Row Count 4 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}----} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.54747 cm} x{4.42953 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{egrep(1)}} \tn % Row 0 \SetRowColor{LightBackground} `-e` & Specifies the pattern \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} `-f` & Get patterns from file lines \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} `-i` & Case insensitive \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} `-v` & Select non-matching lines \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} `-w` & Match whole words only \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} `-c` & Show (non-)matching lines count \tn % Row Count 6 (+ 1) % Row 6 \SetRowColor{LightBackground} `-q` & Quiet (exit 0 when match) \tn % Row Count 7 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.89126 cm} x{3.08574 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{test(1)}} \tn % Row 0 \SetRowColor{LightBackground} `( EXPRESSION )` & is true \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} `! EXPRESSION` & is false \tn % Row Count 3 (+ 1) % Row 2 \SetRowColor{LightBackground} `EXP -a EXP` & Logic AND \tn % Row Count 4 (+ 1) % Row 3 \SetRowColor{white} `EXP -o EXP` & Logic OR \tn % Row Count 5 (+ 1) % Row 4 \SetRowColor{LightBackground} `-n STRING` & Not null string \tn % Row Count 6 (+ 1) % Row 5 \SetRowColor{white} `-z STRING` & Null string \tn % Row Count 7 (+ 1) % Row 6 \SetRowColor{LightBackground} `STR = STR` & Strings are equal \tn % Row Count 8 (+ 1) % Row 7 \SetRowColor{white} `STR != STR` & Strings are different \tn % Row Count 9 (+ 1) % Row 8 \SetRowColor{LightBackground} `INT -eq INT` & Numbers are equal \tn % Row Count 10 (+ 1) % Row 9 \SetRowColor{white} `INT -ne INT` & Numbers are different \tn % Row Count 11 (+ 1) % Row 10 \SetRowColor{LightBackground} `-ge, -gt` & \textgreater{}=, \textgreater{} \tn % Row Count 12 (+ 1) % Row 11 \SetRowColor{white} `-le, -lt` & \textless{}=, \textless{} \tn % Row Count 13 (+ 1) % Row 12 \SetRowColor{LightBackground} `FILE1 -ef FILE2` & Same device and inode \tn % Row Count 15 (+ 2) % Row 13 \SetRowColor{white} `FILE1 -nt FILE2` & F1 is newer than F2 \tn % Row Count 17 (+ 2) % Row 14 \SetRowColor{LightBackground} `FILE1 -ot FILE2` & F1 is older than F2 \tn % Row Count 19 (+ 2) % Row 15 \SetRowColor{white} `-b, -c, -d, -f` & block, chars, dir, regular \tn % Row Count 21 (+ 2) % Row 16 \SetRowColor{LightBackground} `-e, -r, -w, -x` & exists, read, write, exec \tn % Row Count 23 (+ 2) % Row 17 \SetRowColor{white} `-t FD` & File descriptor FD is opened \tn % Row Count 25 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.19448 cm} x{3.78252 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{stat(1)}} \tn % Row 0 \SetRowColor{LightBackground} `-c` & Specifies output format \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} `\%a, \%A` & Access rights octal, human \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} `\%b, \%s` & Size in block, bytes \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} `\%F` & File type \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} `\%g, \%G` & Group owner id, name \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} `\%h` & Number of names (links) \tn % Row Count 6 (+ 1) % Row 6 \SetRowColor{LightBackground} `\%i` & Inode number \tn % Row Count 7 (+ 1) % Row 7 \SetRowColor{white} `\%n, \$N` & File name, quoted \tn % Row Count 8 (+ 1) % Row 8 \SetRowColor{LightBackground} `\%t, \%T` & Device major, minor \tn % Row Count 9 (+ 1) % Row 9 \SetRowColor{white} `\%u, \%U` & User owner id, name \tn % Row Count 10 (+ 1) % Row 10 \SetRowColor{LightBackground} `\%x, \%X` & Last access time, epoch \tn % Row Count 11 (+ 1) % Row 11 \SetRowColor{white} `\%y, \%Y` & Last modified time, epoch \tn % Row Count 12 (+ 1) % Row 12 \SetRowColor{LightBackground} `\%z, \%Z` & Last changed time, epoch \tn % Row Count 13 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.4977 cm} x{4.4793 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{tr(1)}} \tn % Row 0 \SetRowColor{LightBackground} -c & Use complement of SET1 \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} -d & delete chars from SET1 \tn % Row Count 2 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{Translation occurs if -d is not given and both SET1 and SET2 appear. SET2 is extended to length of SET1 by repeating its last character as necessary. Excess characters of SET2 are ignored.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.19448 cm} x{3.78252 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{sed(1)}} \tn % Row 0 \SetRowColor{LightBackground} `-e {\emph{cmd}}` & Multi-command mode \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} `=` & Current line number \tn % Row Count 3 (+ 1) % Row 2 \SetRowColor{LightBackground} `a\textbackslash{}` & Append text \tn % Row Count 4 (+ 1) % Row 3 \SetRowColor{white} `i\textbackslash{}` & Insert text \tn % Row Count 5 (+ 1) % Row 4 \SetRowColor{LightBackground} `c\textbackslash{}` & Replace lines \tn % Row Count 6 (+ 1) % Row 5 \SetRowColor{white} `d` & Delete pattern \tn % Row Count 7 (+ 1) % Row 6 \SetRowColor{LightBackground} `s` & Replace pattern \tn % Row Count 8 (+ 1) % Row 7 \SetRowColor{white} `g` & Apply globally (more than once) \tn % Row Count 10 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{`{[} line\_n {[} ,line\_n {]} {]} commnad {[} parameters {]}` \newline `! line\_n command {[}parameters{]}` \newline `{[} line\_n, \$ {]} commnad {[} parameters {]}`} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{1.41887 cm} p{1.41887 cm} p{1.73926 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{5.377cm}}{\bf\textcolor{white}{ps(1) {[}FORMAT{]}}} \tn % Row 0 \SetRowColor{LightBackground} pid & state & user \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} ruser & group & rgroup \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} pid & ppid & pgid \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} pcpu & nice & etime \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} time & tty & comm \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} \mymulticolumn{3}{x{5.377cm}}{args} \tn % Row Count 6 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.89126 cm} x{3.08574 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{xargs(1)}} \tn % Row 0 \SetRowColor{LightBackground} `-i` & permite el uso de \{\} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} `-r` & No run if empty \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} `-{}-null, -0` & Null terminated args \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} `-d` & Delimiter \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} `-n` & Max args \tn % Row Count 5 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}