\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{hal9000} \pdfinfo{ /Title (linux-command-for-na.pdf) /Creator (Cheatography) /Author (hal9000) /Subject (linux command for NA 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}{3992A3} \definecolor{LightBackground}{HTML}{F2F8F9} \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 command for NA Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{hal9000} via \textcolor{DarkBackground}{\uline{cheatography.com/193391/cs/40231/}}} \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}hal9000 \\ \uline{cheatography.com/hal9000} \\ \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 11th September, 2023.\\ 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{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Filemanager}} \tn % Row 0 \SetRowColor{LightBackground} cd \textless{}Directory Path\textgreater{} & Change directory \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} mv \textless{}Source Path\textgreater{} \textless{}Destination Path\textgreater{} & Move file (It will not work recursively for directories) \tn % Row Count 4 (+ 3) % Row 2 \SetRowColor{LightBackground} rm {[}-rf{]}\textless{}File or directory Path\textgreater{} & Remove file (-r for directories) \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} ll \textless{}Directory Path\textgreater{} & List files and directoris \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} ls {[}-ltrh{]} \textless{}Directory Path\textgreater{} & List files and directoris (comprehensive) \tn % Row Count 11 (+ 3) % Row 5 \SetRowColor{white} stat \textless{}File Path\textgreater{} & Display file or file system status \tn % Row Count 13 (+ 2) % Row 6 \SetRowColor{LightBackground} fsort \textless{}Directory Path\textgreater{} & Sorted List \tn % Row Count 15 (+ 2) % Row 7 \SetRowColor{white} du {[}-sh{]} \textless{}Directory Path\textgreater{} & Estimate file space usage (Human readable) \tn % Row Count 18 (+ 3) % Row 8 \SetRowColor{LightBackground} tar {[}-zxvf{]} \textless{}File Path\textgreater{} & z:Gzip j:Bzip2 -v:Verbose x:Extract c:Create f:file \tn % Row Count 21 (+ 3) % Row 9 \SetRowColor{white} wget \textless{}http or https link\textgreater{} & Network downloader \tn % Row Count 23 (+ 2) % Row 10 \SetRowColor{LightBackground} set-perms {[}-v|-vv{]} DOMAIN & Change Permision \tn % Row Count 25 (+ 2) % Row 11 \SetRowColor{white} zip {[}-r{]} \textless{}File Name\textgreater{} \textless{}Directory to store\textgreater{} & Compress file of Folder \tn % Row Count 28 (+ 3) % Row 12 \SetRowColor{LightBackground} unzip \textless{}File Name\textgreater{} \textless{}Direcory to Extract\textgreater{} & Extract Zip file \tn % Row Count 30 (+ 2) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Filemanager (cont)}} \tn % Row 13 \SetRowColor{LightBackground} dsu-new-snapshot & Disk Space Usage Summary \tn % Row Count 2 (+ 2) % Row 14 \SetRowColor{white} dsu-view-snapshot & Disk Space Usage (In the form of a table) \tn % Row Count 5 (+ 3) % Row 15 \SetRowColor{LightBackground} gdrvdl \textless{}Google Drive link\textgreater{} & Download from GoogleDrive \tn % Row Count 7 (+ 2) % Row 16 \SetRowColor{white} docroot \textless{}Domain name\textgreater{} & Home direcotry for specify domain \tn % Row Count 9 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{2.8 cm} x{5.2 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{DNS Managment}} \tn % Row 0 \SetRowColor{LightBackground} \seqsplit{dns-add-zone-rec} & -n domain.com. -t A -v "195.28.10.117" domain.com \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \seqsplit{dns-delete-zone-rec} & -n domain.com. -t A -v "195.28.10.117" domain.com \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} \seqsplit{dns-edit-zone-rec} & -n domain.com. -t A -v "195.28.10.117" domain.com \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} dns-scan-zone \textless{}Domain\textgreater{} & Display SPF Records \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} dns-cat-zone \textless{}Domain\textgreater{} & Display domain zone \tn % Row Count 10 (+ 2) % Row 5 \SetRowColor{white} zone-cat \textless{}Domain\textgreater{} & Display domain zone \tn % Row Count 12 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{\{\{ac\}\}برای افزودن، حذف و تغییر رکورد های لازم است مطابق با مثال مقادیررا به ترتیب وارد فرمایید\{\{ac\}\}\{\{nl\}\}\{\{ac\}\}در زمان ایجاد رکورد لازم است کاراکتر نقطه در انتهای نام دامنه درج شود\{\{ac\}\}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{1.6 cm} x{6.4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{CMS}} \tn % Row 0 \SetRowColor{LightBackground} wp-home & Display the home page of the website \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \seqsplit{wp-plugins} & Display WordPress site plugins \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} \seqsplit{wp-theme} & Display Active theme of the WordPress website \tn % Row Count 6 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Cheking website}} \tn % Row 0 \SetRowColor{LightBackground} dig \textless{}Rec Type\textgreater{} \textless{}Domain\textgreater{} \{@ns.netafraz.com\} & Check published DNS records \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} ip2l \textless{}IP\textgreater{} & IP location \tn % Row Count 4 (+ 1) % Row 2 \SetRowColor{LightBackground} ipcheck \textless{}IP\textgreater{} & Display location, time-zone, SMTP hostname, Reverse record \tn % Row Count 7 (+ 3) % Row 3 \SetRowColor{white} whois \textless{}Domain\textgreater{} & Whois Service \tn % Row Count 8 (+ 1) % Row 4 \SetRowColor{LightBackground} curl -I \textless{}Domain/Link\textgreater{} & load and transfer a URL \tn % Row Count 10 (+ 2) % Row 5 \SetRowColor{white} lurl \textless{}Domain/Link\textgreater{} & Load from server side without using DNS service \tn % Row Count 13 (+ 3) % Row 6 \SetRowColor{LightBackground} timeout -k 2 2 telnet \textless{}Domain\textgreater{} 21 & Dispaly Reverse DNS record \tn % Row Count 15 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{3.6 cm} x{4.4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Backups}} \tn % Row 0 \SetRowColor{LightBackground} \seqsplit{list-backup-archives} & List of direct admin configuration backups \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \seqsplit{bk-list-weekly-archives} & List of direct admin configuration backups \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} mk-backups-dir \textless{}Username\textgreater{} & Create a backups directory for user \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} cptoda-dump \textless{}Filename\textgreater{} & Display information available in Cpanel backup \tn % Row Count 9 (+ 3) % Row 4 \SetRowColor{LightBackground} backup-mount & Mount the direcotry related to weekly backup \tn % Row Count 11 (+ 2) % Row 5 \SetRowColor{white} backup-umount & Unmount the direcotry related to weekly backup \tn % Row Count 14 (+ 3) % Row 6 \SetRowColor{LightBackground} \seqsplit{da-restore-user-backup} \textless{}Filename\textgreater{} & Restore direct admin backup \tn % Row Count 16 (+ 2) % Row 7 \SetRowColor{white} weekly\_backupdir & Weekly backup path \tn % Row Count 17 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{3.44 cm} x{4.56 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Database}} \tn % Row 0 \SetRowColor{LightBackground} db-list & Databases List \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} db-info \textless{}DATABASE\textgreater{} & Display information of database tables \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} importdb \textless{}DATABASE\textgreater{} \textless{}SQL\_FILE\textgreater{} & Import SQL file to specified Database \tn % Row Count 5 (+ 2) % Row 3 \SetRowColor{white} backupdb \textless{}DATABASE\textgreater{} \textless{}SQL\_FILE\textgreater{} & Export Database to SQL File \tn % Row Count 7 (+ 2) % Row 4 \SetRowColor{LightBackground} db-create {[}-s{]} & Create Database by random password \tn % Row Count 9 (+ 2) % Row 5 \SetRowColor{white} db-drop \textless{}DATABASE\textgreater{} & Delete Database \tn % Row Count 11 (+ 2) % Row 6 \SetRowColor{LightBackground} cms-dbpasswd {[}wp, jm{]} & Reseting database password of a known CMS \tn % Row Count 13 (+ 2) % Row 7 \SetRowColor{white} cms-dbdump {[}wp, jm{]} & Display database parameters of a known CMS \tn % Row Count 15 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Domain}} \tn % Row 0 \SetRowColor{LightBackground} dm-list & Display the list of domains \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} dm-create \textless{}Domain name\textgreater{} & Add new domain \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} dm-delete \textless{}Delete name\textgreater{} & Delete a domain \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} dm-owner \textless{}Domain name\textgreater{} & Display usernames that use this domain or subdomains based on this domain \tn % Row Count 10 (+ 4) % Row 4 \SetRowColor{LightBackground} dom-rename \textless{}OLD\_DOMAIN\textgreater{} \textless{}NEW\_DOMAIN\textgreater{} & Change domain name \tn % Row Count 12 (+ 2) % Row 5 \SetRowColor{white} dmsetphpver \textless{}DOMAIN\textgreater{} \textless{}PHPVER\textgreater{} & Changing the php version of the domain \tn % Row Count 14 (+ 2) % Row 6 \SetRowColor{LightBackground} dmshowconf \textless{}DOMAIN\textgreater{} & View Domain Settings \tn % Row Count 15 (+ 1) % Row 7 \SetRowColor{white} dm-wellknown \textless{}DOMAIN\textgreater{} {[}on/off{]} & Create access to the .well-known directory \tn % Row Count 18 (+ 3) % Row 8 \SetRowColor{LightBackground} ttlset \textless{}DOMAIN\textgreater{} 100 & Set domain ttl value to 100 \tn % Row Count 20 (+ 2) % Row 9 \SetRowColor{white} usr-chttl \textless{}UserName\textgreater{}100 & Set all domain's ttl value to 100 \tn % Row Count 22 (+ 2) % Row 10 \SetRowColor{LightBackground} dmnginxstatic \textless{}DOMAIN\textgreater{} {[}on/off{]} & Disable static request from Nginx web server side \tn % Row Count 25 (+ 3) % Row 11 \SetRowColor{white} \seqsplit{dm-contact-forms-geolimits} \textless{}DOMAIN\textgreater{} {[}on/off{]} & Activating access to Contact-Forms from abroad \tn % Row Count 28 (+ 3) % Row 12 \SetRowColor{LightBackground} dm-set-wp-geolimits \textless{}DOMAIN\textgreater{} {[}on/off{]} & Activating access to Wordpress dashboard from abroad \tn % Row Count 31 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{3.92 cm} x{4.08 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Email-Accounts}} \tn % Row 0 \SetRowColor{LightBackground} mailadd \textless{}EMAIL\_ACCOUNT\textgreater{} & add an email account \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} mailmod {[}OPTIONS{]} \textless{}EMAIL\_ACCOUNT\textgreater{} & modify an email account \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} mailrm \textless{}EMAIL\_ACCOUNT\textgreater{} & remove an email account \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} mailsus \textless{}EMAIL\_ACCOUNT\textgreater{} {[}on/off{]} & Suspend an email account \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} maills & Display the list of created emails \tn % Row Count 10 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Direct admin}} \tn % Row 0 \SetRowColor{LightBackground} usr-inc-traffic & Increase bandwidth by 10\% \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} usr-quota & Free disk and inode capacity \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} usr-pkg & Account Summary information of the Direct Admin panel \tn % Row Count 7 (+ 3) % Row 3 \SetRowColor{white} npsp-show-conf & Open ports and service connection restrictions \tn % Row Count 10 (+ 3) % Row 4 \SetRowColor{LightBackground} npsp-ftp & ftp access via php \tn % Row Count 11 (+ 1) % Row 5 \SetRowColor{white} da-msg & Display direct admin messages \tn % Row Count 13 (+ 2) % Row 6 \SetRowColor{LightBackground} catcust \textless{}Domain\textgreater{} & Display custom Apache config \tn % Row Count 15 (+ 2) % Row 7 \SetRowColor{white} cpi-cat & Check active modules (Memcached) \tn % Row Count 17 (+ 2) % Row 8 \SetRowColor{LightBackground} php-extention list & Display the list of php modules that can be activated \tn % Row Count 20 (+ 3) % Row 9 \SetRowColor{white} php-extention \textless{}php modules name\textgreater{} {[}on/off{]} & php module activation \tn % Row Count 23 (+ 3) % Row 10 \SetRowColor{LightBackground} ftp-acl add \textless{}USER\textgreater{} perm \textless{}IP\textgreater{} & Add IP to connect to FTP from abroad permanently \tn % Row Count 26 (+ 3) % Row 11 \SetRowColor{white} ftp-acl add \textless{}USER\textgreater{} temp \textless{}IP\textgreater{} \{Hours\} & Add IP to connect to FTP from abroad temporarily by hours \tn % Row Count 29 (+ 3) % Row 12 \SetRowColor{LightBackground} respkg & Information about reseller users \tn % Row Count 31 (+ 2) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Direct admin (cont)}} \tn % Row 13 \SetRowColor{LightBackground} userdom \textless{}Domain\textgreater{}user & Convert username to domain and vice versa \tn % Row Count 3 (+ 3) % Row 14 \SetRowColor{white} userdom \textless{}Username\textgreater{} & Convert username to domain and vice versa \tn % Row Count 6 (+ 3) % Row 15 \SetRowColor{LightBackground} userips & Display Web IP \tn % Row Count 7 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{\{\{ac\}\}دستور افزایش پهنای باند تنها در مواقعی اعمال شده که پهنای باند سرویس کاربر به اتمام رسیده باشد\{\{ac\}\}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}