\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{Nitrym} \pdfinfo{ /Title (linux-befehle.pdf) /Creator (Cheatography) /Author (Nitrym) /Subject (Linux Befehle 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}{813CA3} \definecolor{LightBackground}{HTML}{F7F2F9} \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 Befehle Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{Nitrym} via \textcolor{DarkBackground}{\uline{cheatography.com/211228/cs/45726/}}} \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}Nitrym \\ \uline{cheatography.com/nitrym} \\ \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 25th February, 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*}{3} \begin{tabularx}{5.377cm}{p{0.54747 cm} x{4.42953 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{A}} \tn % Row 0 \SetRowColor{LightBackground} alias & lets you set another name for a string that belongs to a file, text, program or command name \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} apt & lets you manage advanced package tool libraries in Debian-based operating systems such as Ubuntu and Kali \tn % Row Count 6 (+ 3) % Row 2 \SetRowColor{LightBackground} awk & searches and manipulates regular expression pattern in a file \tn % Row Count 8 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{C}} \tn % Row 0 \SetRowColor{LightBackground} cal & displays a calendar in your Linux command-line interface \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} cat & printing the content of a file \tn % Row Count 5 (+ 2) % Row 2 \SetRowColor{LightBackground} cd \{\{nl\}\} \{\{nl\}\} \{\{nl\}\} cd .. \{\{nl\}\} cd - & to navigate between directories \{\{nl\}\} returns to the current user's home directory \{\{nl\}\} moves a directory up \{\{nl\}\} goes back to the previous directory \tn % Row Count 13 (+ 8) % Row 3 \SetRowColor{white} chmod & change the permissions of files or directories \{\{nl\}\} chmod -rwx-{}-{}-r-– file.txt \{\{nl\}\} owner, group, other accounts \{\{nl\}\}r: read \{\{nl\}\} w: write \{\{nl\}\} x: execute \tn % Row Count 22 (+ 9) % Row 4 \SetRowColor{LightBackground} chown & lets you change the ownership of files, directories or symbolic links \tn % Row Count 26 (+ 4) % Row 5 \SetRowColor{white} cp & copy files from your current directory to another folder \tn % Row Count 29 (+ 3) % Row 6 \SetRowColor{LightBackground} curl & transfer data from or to a server by specifiying its URL \tn % Row Count 32 (+ 3) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{C (cont)}} \tn % Row 7 \SetRowColor{LightBackground} cut\{\{nl\}\}\{\{nl\}\}\{\{nl\}\} \{\{nl\}\} -f \{\{nl\}\} -b \{\{nl\}\} -c \{\{nl\}\}\{\{nl\}\} -d & selects specific sections from a file and print them as a terminal output \{\{nl\}\}cut options file \{\{nl\}\} options are mandatory \{\{nl\}\} selects a specific row field \{\{nl\}\} cuts the line by a specified byte size \{\{nl\}\} sections the line using a specified character \{\{nl\}\} separates lines based on delimiters \tn % Row Count 16 (+ 16) \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}{D}} \tn % Row 0 \SetRowColor{LightBackground} df & checks your Linux system's disk usage \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} diff & compares two files and prints their differences \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} dig & displays information about a domain \tn % Row Count 5 (+ 1) % Row 3 \SetRowColor{white} du & check the size of a directory and its content \tn % Row Count 7 (+ 2) \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}{E}} \tn % Row 0 \SetRowColor{LightBackground} echo & print text in your command as a terminal output \tn % Row Count 2 (+ 2) \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}{F}} \tn % Row 0 \SetRowColor{LightBackground} file & checks a file type, such as txt, pdf or other \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} find & searches for a file in a specific directory \tn % Row Count 4 (+ 2) \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}{G}} \tn % Row 0 \SetRowColor{LightBackground} grep & lets you search specific lines from a file using keywords \tn % Row Count 2 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{0.9954 cm} x{3.9816 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{H}} \tn % Row 0 \SetRowColor{LightBackground} head & print the first few entries of a file / by default the first 10 lines \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} history & checks previously run utilities \tn % Row Count 4 (+ 1) % Row 2 \SetRowColor{LightBackground} \seqsplit{hostname} & checks your VPS hostname and other related information \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} htop & lets you display and manage processes in your Linux server / lets you add additional options \tn % Row Count 9 (+ 3) % Row 4 \SetRowColor{LightBackground} {\bf{-{}-help}} & gives you information about a command (command -{}-help)\{\{nl\}\}with {\bf{| {\emph{less}}}} you can cut a long help description into pieces of sites \tn % Row Count 14 (+ 5) \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}{I}} \tn % Row 0 \SetRowColor{LightBackground} ip & lets you list and manage your systems network parameters, similar to the ifconfig command in older linux distributions \tn % Row Count 4 (+ 4) \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}{J}} \tn % Row 0 \SetRowColor{LightBackground} jobs & are tasks or commands that are running in your current shell \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} jed & lets you edit files \tn % Row Count 3 (+ 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}{K}} \tn % Row 0 \SetRowColor{LightBackground} kill & terminate a procces using its ID \tn % Row Count 1 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.64701 cm} x{4.32999 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{L}} \tn % Row 0 \SetRowColor{LightBackground} ln & links files or directories with a shortcut \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \seqsplit{locate} & searches for a file and print its location path / updatedb \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} ls & lists the content of a folder, including files and directories. \tn % Row Count 6 (+ 2) \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}{M}} \tn % Row 0 \SetRowColor{LightBackground} man & displays a comprehensive guide of another utility \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} mkdir & create one or multiple directories \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} mv & move a file or folder to another location, also can rename files \tn % Row Count 6 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{N}} \tn % Row 0 \SetRowColor{LightBackground} nano & lets you edit files \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} netstat \{\{nl\}\}\{\{nl\}\} -a \{\{nl\}\} -t \{\{nl\}\} -u \{\{nl\}\} -r \{\{nl\}\} -i \{\{nl\}\}\{\{nl\}\}\{\{nl\}\} -c & displays information about your systems network configuration \{\{nl\}\} displays listening and closed sockets \{\{nl\}\} shows TCP connections \{\{nl\}\} lists UDP connections \{\{nl\}\} displays routing tables \{\{nl\}\} shows information about network interfaces \{\{nl\}\}continuously outputs network information for real-time monitoring \tn % Row Count 17 (+ 16) % Row 2 \SetRowColor{LightBackground} nslookup & requests a domain name system (DNS) server to check a domain linked to an IP adress or vice versa \tn % Row Count 22 (+ 5) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.64701 cm} x{4.32999 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{P}} \tn % Row 0 \SetRowColor{LightBackground} \seqsplit{passwd} & add or change a password manually later \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} ping & sends packets to a target server and fetches the responses \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} ps & summarizes the status of all running processes in your Linux systems at a specific time \{\{nl\}\} doesnt update the information automatically \tn % Row Count 9 (+ 5) % Row 3 \SetRowColor{white} pwd & checks the full path of your current working directory \tn % Row Count 11 (+ 2) \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}{R}} \tn % Row 0 \SetRowColor{LightBackground} rm & deletes files from a directory \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} rmdir & delete empty directories, doesnt work with subfolders \tn % Row Count 3 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{0.89586 cm} x{4.08114 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{S}} \tn % Row 0 \SetRowColor{LightBackground} scp & lets you securely copy files and directories between systems over a network \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} sed & search and replace patterns in files quickly \tn % Row Count 5 (+ 2) % Row 2 \SetRowColor{LightBackground} \seqsplit{shutdown} & turn off or restart your linux system at a specific time \tn % Row Count 7 (+ 2) % Row 3 \SetRowColor{white} sort & rearrange a file's content in a specific order / doesnt modify the file, print the rearanged as output default from a-z \tn % Row Count 11 (+ 4) % Row 4 \SetRowColor{LightBackground} su & switch to another user in the terminal session \tn % Row Count 13 (+ 2) % Row 5 \SetRowColor{white} {\bf{sudo}} & enables non-root users who are part of the sudo group to execute administrative commands \tn % Row Count 16 (+ 3) % Row 6 \SetRowColor{LightBackground} \seqsplit{systemctl} & manage services in your linux system \tn % Row Count 18 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{0.9954 cm} x{3.9816 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{T}} \tn % Row 0 \SetRowColor{LightBackground} tail & print the last few lines of a file \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} tar & bundles multiple files or directories into an archive without compression \tn % Row Count 5 (+ 3) % Row 2 \SetRowColor{LightBackground} tee & outputs another commands result to both the terminal and a file \tn % Row Count 7 (+ 2) % Row 3 \SetRowColor{white} time & measures the execution time of commands or scripts to gain insights into your system performance \tn % Row Count 10 (+ 3) % Row 4 \SetRowColor{LightBackground} top & displays all running processes in your system and their hardware consumption \tn % Row Count 13 (+ 3) % Row 5 \SetRowColor{white} touch & create a new empty file in a specific directory \tn % Row Count 15 (+ 2) % Row 6 \SetRowColor{LightBackground} \seqsplit{traceroute} & tracks a packet's path when traveling between hosts, providing information like the transfer time and involved routers \tn % Row Count 19 (+ 4) \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}{U}} \tn % Row 0 \SetRowColor{LightBackground} \seqsplit{unalias} & remove an alias \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} uname & displays detailed information about your linux machine, including hardware, name and operating system kernel \tn % Row Count 6 (+ 4) % Row 2 \SetRowColor{LightBackground} unzip & decompresses one or multiple files from a zip archive \tn % Row Count 8 (+ 2) % Row 3 \SetRowColor{white} \seqsplit{useradd} & create a new account in your linux system \tn % Row Count 10 (+ 2) % Row 4 \SetRowColor{LightBackground} \seqsplit{userdel} & remove a user \tn % Row Count 12 (+ 2) \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}{V}} \tn % Row 0 \SetRowColor{LightBackground} vi & lets you edit files \tn % Row Count 1 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.64701 cm} x{4.32999 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{W}} \tn % Row 0 \SetRowColor{LightBackground} watch & lets you continuously run a utility at a specific interval to monitor changes in the output \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} wget & lets you download files from the internet via http, https or ftp \tn % Row Count 5 (+ 2) % Row 2 \SetRowColor{LightBackground} \seqsplit{whoami} & checks the user who is currently logged-in \tn % Row Count 7 (+ 2) \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}{Z}} \tn % Row 0 \SetRowColor{LightBackground} zip & compresses one or multiple files into a zip archive \tn % Row Count 2 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}