\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{steven.jeanneret} \pdfinfo{ /Title (os-part2-linux.pdf) /Creator (Cheatography) /Author (steven.jeanneret) /Subject (OS\_part2\_linux 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}{0062A3} \definecolor{LightBackground}{HTML}{EFF5F9} \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{OS\_part2\_linux Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{steven.jeanneret} via \textcolor{DarkBackground}{\uline{cheatography.com/32278/cs/10375/}}} \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}steven.jeanneret \\ \uline{cheatography.com/steven-jeanneret} \\ \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 4th January, 2017.\\ 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*}{4} \begin{tabularx}{3.833cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{3.833cm}}{\bf\textcolor{white}{Linux File System}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{Tous est fichier ou processus} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{Un processus est un fichier ouvert} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{Le caractère / n'est pas autorisé dans le nom d'un fichier} \tn % Row Count 4 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{p{0.75526 cm} x{2.67774 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{3.833cm}}{\bf\textcolor{white}{Structure de fichiers GNU/Linux}} \tn % Row 0 \SetRowColor{LightBackground} / & Répertoire racine \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} /bin/ & Commandes de base du système \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} /boot/ & Noyau et fichiers de configuration \tn % Row Count 4 (+ 2) % Row 3 \SetRowColor{white} /dev/ & Fichiers représentant des périphériques \tn % Row Count 6 (+ 2) % Row 4 \SetRowColor{LightBackground} /etc/ & Fichiers de configuration du système \tn % Row Count 8 (+ 2) % Row 5 \SetRowColor{white} /lib/ & Bibliothèques de base du système \tn % Row Count 10 (+ 2) % Row 6 \SetRowColor{LightBackground} \seqsplit{/lost+found} & Fichiers détériorés que le système a essayé de récupérer \tn % Row Count 13 (+ 3) % Row 7 \SetRowColor{white} /opt/ & Outils spécifiques installés par l'administrateur (souvent remplacé par /usr/local/) \tn % Row Count 16 (+ 3) % Row 8 \SetRowColor{LightBackground} /proc/ & Accès aux informations du système \tn % Row Count 18 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{p{0.6866 cm} x{2.7464 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{3.833cm}}{\bf\textcolor{white}{Chemins}} \tn % Row 0 \SetRowColor{LightBackground} /dir/ & Commence par / est dit absolu, il part de la racine \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} dir/ & Chemin relatif, commence depuis le répertoire courant \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} \textasciitilde{}dir/ & Chemin de type user, part du répertoire personnel de l'utilisateur courant \tn % Row Count 7 (+ 3) % Row 3 \SetRowColor{white} \textasciitilde{}user/dir/ & Part du répertoire personnel de l'utilisateur spécifié \tn % Row Count 9 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{3.833cm}}{\bf\textcolor{white}{Commande de base}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{mount | affiche syst. fichier montés} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{umount |détacher montage} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{mount device dir | monte device sur dir} \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{df {[}chemin{]} | show cap. tot. d'un système de fichiers df /users} \tn % Row Count 5 (+ 2) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{du {[}-s{]} {[}chemin{]} | taille occupée file or directory} \tn % Row Count 7 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{p{0.58361 cm} x{2.84939 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{3.833cm}}{\bf\textcolor{white}{Commande interne ou externe}} \tn % Row 0 \SetRowColor{LightBackground} type cd & cd is a shell builtin | cmd interne \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} type ls & ls is /usr/bin/ls | cmd externe \tn % Row Count 4 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{3.833cm}}{Les commandes externes sont exécutés par l'intermédiaire d'un shell enfant. \newline Les commandes internes sont directement intégrée au processus shell} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{3.833cm}}{\bf\textcolor{white}{Droit d'accès}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{Le propriétaire du fichier} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{Les utilisateurs du même groupe de travail que le propriétaire} \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{Les autres utilisateurs} \tn % Row Count 4 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{Lecture (r)} \tn % Row Count 5 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{Ecriture (w)} \tn % Row Count 6 (+ 1) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{Exécution (x)} \tn % Row Count 7 (+ 1) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{Ces droits peuvent être changé que par le propriétaire du fichier (chmod)} \tn % Row Count 9 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{-rwxr-{}-{}-{}-- \newline Le premier - fichier ordinaire. \newline Le propriétaire peut rwx \newline Les utilisateurs du même groupe peuvent r \newline Les autres utilisateurs n'ont aucun droit.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{x{0.92691 cm} x{2.50609 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{3.833cm}}{\bf\textcolor{white}{Manipulation de fichiers}} \tn % Row 0 \SetRowColor{LightBackground} cat file1 file2 & show content of file1 file2 ... \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} tac file1 file2 & show content of file1 from the end to the top and file2 from the end \tn % Row Count 5 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{x{0.92691 cm} x{2.50609 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{3.833cm}}{\bf\textcolor{white}{Manipulation de fichiers}} \tn % Row 0 \SetRowColor{LightBackground} cat file1 file2 & show content of file1 file2 ... \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} tac file1 file2 & show content of file1 from the end to the top and file2 from the end \tn % Row Count 5 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{x{0.99557 cm} x{2.43743 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{3.833cm}}{\bf\textcolor{white}{Variables d'environnement}} \tn % Row 0 \SetRowColor{LightBackground} env & Affiche la liste des variables d'env. \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} Var = val & Créer Var avec la valeur val (process actif) \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} export Var = val & Créer Var avec val (process actif et sous-process) \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} echo \$Var & affiche la val de Var \tn % Row Count 7 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{3.833cm}}{\bf\textcolor{white}{Utilitaires UNIX}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{compress {[}file{]}} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{diff file1 file2 | compare ligne à ligne} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{file fichier | détermine le type de fichier} \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{find {[}options{]}} \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{find . -name "*.pdf"} \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{find docs -name "*.pdf" -exec xpdf \{\} `:´} \tn % Row Count 6 (+ 1) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{-empty | les fichiers vides} \tn % Row Count 7 (+ 1) % Row 7 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{-name filename | les fichiers filename} \tn % Row Count 8 (+ 1) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{-type filetype | les fichiers de type} \tn % Row Count 9 (+ 1) % Row 9 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{type : d (directory) f (file) l (link)} \tn % Row Count 10 (+ 1) % Row 10 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{-newer filename | plus récent que filename} \tn % Row Count 11 (+ 1) % Row 11 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{-size {[}+-{]}n | recherche par taille} \tn % Row Count 12 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{3.833cm}}{\bf\textcolor{white}{alias}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{alias ls='ls -la' | ls par ls -la dans le script} \tn % Row Count 1 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{x{1.13289 cm} x{2.30011 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{3.833cm}}{\bf\textcolor{white}{Méta-caractères shell}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{3.833cm}}{Les méta-caractères sont interprétés spécialement par le shell avant de lancer la commande} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} ls *.c & Le shell remplace *.c par les fichiers courant dont le nom termine par .c \tn % Row Count 5 (+ 3) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{2}{x{3.833cm}}{Avant d'exécuter, le shell analyse la ligne et remplace les méta-caractères} \tn % Row Count 7 (+ 2) % Row 3 \SetRowColor{white} * & Remplace une suite de caractères (null à l'infini) \tn % Row Count 9 (+ 2) % Row 4 \SetRowColor{LightBackground} ? & Remplace un seul caractère \tn % Row Count 11 (+ 2) % Row 5 \SetRowColor{white} {[}{]} & Remplace un des caractères ou intervalle {[}a-z{]} \tn % Row Count 13 (+ 2) % Row 6 \SetRowColor{LightBackground} ls {[}hg{]}* & tous fichiers commençant par h ou g \tn % Row Count 15 (+ 2) % Row 7 \SetRowColor{white} ls {\emph{.{[}a-z{]}.}} & Tous fichiers ayant .une\_lettre. \tn % Row Count 17 (+ 2) % Row 8 \SetRowColor{LightBackground} \{\} & Remplace par chaque élément {[}a,b,c{]} \tn % Row Count 19 (+ 2) % Row 9 \SetRowColor{white} ls file\_\{unix,linux\} & affiche le fichier file\_unix et file\_linux \tn % Row Count 21 (+ 2) % Row 10 \SetRowColor{LightBackground} ls '*.c' & Empêche l'interprétation des méta-caractères \tn % Row Count 23 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{3.833cm}}{\bf\textcolor{white}{Manipulation de fichiers}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{cat file1 file2 | show content of file1 file2 ...} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{zcat file | décompress et affiche} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{tac file1 file2 | show content of file1 from the end to the top and file2 from the end} \tn % Row Count 4 (+ 2) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{cd dir | se déplace dans dir} \tn % Row Count 5 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{cd | reviens dans le rép de co.} \tn % Row Count 6 (+ 1) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{cd - | reviens dans le rep précèdent} \tn % Row Count 7 (+ 1) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{cd .. | remonte d'un niveau} \tn % Row Count 8 (+ 1) % Row 7 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{cp {[}-ipr{]} src dest | copie src to dest} \tn % Row Count 9 (+ 1) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{-i | demande confirmation si écrasement} \tn % Row Count 10 (+ 1) % Row 9 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{-p | préserve les dates d'accès et modif} \tn % Row Count 11 (+ 1) % Row 10 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{-r | copie récursive (l'arborescence)} \tn % Row Count 12 (+ 1) % Row 11 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{echo message | affiche message} \tn % Row Count 13 (+ 1) % Row 12 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{ls {[}-aldF{]} | affiche le contenu du répertoire} \tn % Row Count 14 (+ 1) % Row 13 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{-l | affiche les droits d'accès} \tn % Row Count 15 (+ 1) % Row 14 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{-a | affiche les fichiers commençant par .} \tn % Row Count 16 (+ 1) % Row 15 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{-d | Décrit le répertoire et pas son contenu} \tn % Row Count 17 (+ 1) % Row 16 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{-F | Format court * si exe / si rep} \tn % Row Count 18 (+ 1) % Row 17 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{mkdir chemin | créer le répertoire chemin} \tn % Row Count 19 (+ 1) % Row 18 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{rmdir chemin | supprime le répertoire} \tn % Row Count 20 (+ 1) % Row 19 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{-{}-ignore-fail-on-non-empty | supprime si non vide} \tn % Row Count 22 (+ 2) % Row 20 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{mv {[}-i{]} src dest | déplace src vers dest (peut servir pour renommer)} \tn % Row Count 24 (+ 2) % Row 21 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{-i | confirmation en cas d'écrasement} \tn % Row Count 25 (+ 1) % Row 22 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{pwd | affiche le répertoire courant} \tn % Row Count 26 (+ 1) % Row 23 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{rm {[}-ri{]} file | supp file} \tn % Row Count 27 (+ 1) % Row 24 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{-i | confirmation pour chacun} \tn % Row Count 28 (+ 1) % Row 25 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{-r | recursive, détruit l'arborescence} \tn % Row Count 29 (+ 1) % Row 26 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{head {[}-n{]} file | affiche les n premières lignes du fichier} \tn % Row Count 31 (+ 2) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{3.833cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{3.833cm}}{\bf\textcolor{white}{Manipulation de fichiers (cont)}} \tn % Row 27 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{tail +8 file | affiche à partir de la ligne 8} \tn % Row Count 1 (+ 1) % Row 28 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{tail -8 file | affiche les 8 dernières lignes} \tn % Row Count 2 (+ 1) % Row 29 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{more file | affiche page par page} \tn % Row Count 3 (+ 1) % Row 30 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{less file | page par page amélioré} \tn % Row Count 4 (+ 1) % Row 31 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{tar cvf namearchive file/dir | créer namearchive contenant file ou dir} \tn % Row Count 6 (+ 2) % Row 32 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{tar tvf namearchive | affiche son contenu} \tn % Row Count 7 (+ 1) % Row 33 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{tar xvf namearchive | décompresse l'archive} \tn % Row Count 8 (+ 1) % Row 34 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{wc {[}-cwl{]} {[}file{]} | affiche le nombre de :} \tn % Row Count 9 (+ 1) % Row 35 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{-c | charactère} \tn % Row Count 10 (+ 1) % Row 36 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{-w | word} \tn % Row Count 11 (+ 1) % Row 37 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{-l | ligne} \tn % Row Count 12 (+ 1) % Row 38 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{who | affiche quel user nous sommes} \tn % Row Count 13 (+ 1) % Row 39 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{touch -acmt file | modifie la date d'accès} \tn % Row Count 14 (+ 1) % Row 40 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{-a | l'heure du dernier accès au file} \tn % Row Count 15 (+ 1) % Row 41 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{-c |ne créer pas les file} \tn % Row Count 16 (+ 1) % Row 42 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{-m | change l'heure de dernière modif.} \tn % Row Count 17 (+ 1) % Row 43 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{-t | utilise la data indiquée au lieu de now} \tn % Row Count 18 (+ 1) % Row 44 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{grep {[}option{]} motif file | affiche les lignes de file qui contiennent motif} \tn % Row Count 20 (+ 2) % Row 45 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{-v | aff lignes qui n'ont pas motif} \tn % Row Count 21 (+ 1) % Row 46 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{-c | seulement le nombre de lignes} \tn % Row Count 22 (+ 1) % Row 47 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{-n | indique les numéros des lignes} \tn % Row Count 23 (+ 1) % Row 48 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{-i | ne distinque pas maj et min} \tn % Row Count 24 (+ 1) % Row 49 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{sort {[}-rnu{]} file | trie les lignes} \tn % Row Count 25 (+ 1) % Row 50 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{-r | reverse -u | évite les doublons -n | tri numérique} \tn % Row Count 27 (+ 2) % Row 51 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{tr chaine1 chaine2 | remplace ch1 par ch2} \tn % Row Count 28 (+ 1) % Row 52 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{uniq {[}-cud{]} file | examine ligne par ligne et détermine lignes duppliquées consécutives} \tn % Row Count 30 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{3.833cm}}{\bf\textcolor{white}{rsync}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{conçu pour syncrhoniser des répertoires sur 2 machines} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{copie que les fichiers changés} \tn % Row Count 3 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{transfère que ce qui change au sein d'un fichier} \tn % Row Count 4 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{peut compresser les blocs transférés} \tn % Row Count 5 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{conserve les permissions} \tn % Row Count 6 (+ 1) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{peut fonctionner via ssh (utile pour maj site web)} \tn % Row Count 7 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{3.833cm}}{\bf\textcolor{white}{Périphériques spéciaux}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{/dev/null | pour se débarrasser d'une sortie} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{/dev/zero | permet de créer un fichier rempli de 0} \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{dd if=/dev/zero of=disk.img bs=1k count=2048} \tn % Row Count 4 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{echo \$RANDOM \textgreater{} file | génére un nombre aléatoire} \tn % Row Count 6 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{3.833cm}}{\bf\textcolor{white}{Contrôle de tâches}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{ls -Ral / \textgreater{} ls-Ral.txt \& | le \& fait tourner la tâche en fond} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{jobs | affiche les tâches qui tournent} \tn % Row Count 3 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{kill {[}-signal{]} num\_tache | arrête la tâche} \tn % Row Count 4 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{sleep n | bloque le shell pendant n sec} \tn % Row Count 5 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{cmd1 ; cmd2 ; cmd3 | sépare les cmd par ;} \tn % Row Count 6 (+ 1) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{cmd1 || cmd2 | cmd2 si cmd1 échoue} \tn % Row Count 7 (+ 1) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{cmd1 \&\& cmd2 | cmd2 si cmd1 ok} \tn % Row Count 8 (+ 1) % Row 7 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{which cmd | affiche le chemin de l'exe} \tn % Row Count 9 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{3.833cm}}{\bf\textcolor{white}{Script}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{La première ligne du script doit préciser l'interpréteur du script.} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{\#! /bin/bash} \tn % Row Count 3 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{Ici nous utilisons bash} \tn % Row Count 4 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{chmod a+x file | rend le scipt exécutable} \tn % Row Count 5 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{3.833cm}}{\bf\textcolor{white}{Entrées / sorties}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{Entrée standard est le clavier} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{Sortie standard est l'écran} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{Sortie standard des erreurs est l'écran} \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{ls \textgreater{} result | redirige la sortie standard dans un fichier} \tn % Row Count 5 (+ 2) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{ls \textgreater{} result | ajoute le contenu dans result} \tn % Row Count 6 (+ 1) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{cat \textless{} file | le paramètre se trouve dans file} \tn % Row Count 7 (+ 1) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{cat \textless{} file \textgreater{} result | entrée file et sortie result} \tn % Row Count 9 (+ 2) % Row 7 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{ls 2\textgreater{} error | redirige les erreurs dans file} \tn % Row Count 10 (+ 1) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{ls \&\textgreater{} file | redirige les erreurs et la sortie std} \tn % Row Count 11 (+ 1) % Row 9 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{ls | sort -r | affiche le contenu du rep à l'envers le | utilise la sortie de cmd1 dans cmd2} \tn % Row Count 13 (+ 2) % Row 10 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{tee {[}-a{]} file | sert à afficher le res d'une cmd à l'écran et dans un fichier} \tn % Row Count 15 (+ 2) % Row 11 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{ifconfig | tee log | affiche res à l'écran et dans log} \tn % Row Count 17 (+ 2) % Row 12 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{-a | ajoute à la suite du fichier} \tn % Row Count 18 (+ 1) % Row 13 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{yes | rm -r dir/ | la cmd yes sert à remplir l'entré ici confirmer la suppression} \tn % Row Count 20 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{3.833cm}}{\bf\textcolor{white}{liens symboliques et physiques}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{Symb. fichier spécial qui est une référence au nom d'un autre (fichhier ou répertoire)} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{ln -s nom\_fichier nom\_lien} \tn % Row Count 3 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{ls -l affiche -\textgreater{} quand c'est un lien} \tn % Row Count 4 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{rm nom\_lien | supp le lien} \tn % Row Count 5 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{Phys. fichier ordinaire avec le même contenu} \tn % Row Count 6 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{3.833cm}}{\bf\textcolor{white}{Manip des processus}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{kill -STOP 1023 | stop le process 1023} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{top | affiche en continu les processus} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{ps {[}-e{]} {[}-l{]} | affiche la liste des process.} \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{-l obtiens plus d'info | -e tous les users} \tn % Row Count 4 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{3.833cm}}{\bf\textcolor{white}{Autres}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{wget url | télécharger un fichier} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{-m fait un site miroir} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{bc | basic calculator -l pour float} \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{Consoles multiples ctrl + alt + F1à6} \tn % Row Count 4 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}