\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{solsolsol} \pdfinfo{ /Title (linux.pdf) /Creator (Cheatography) /Author (solsolsol) /Subject (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}{910C0C} \definecolor{LightBackground}{HTML}{FBF7F7} \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 Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{solsolsol} via \textcolor{DarkBackground}{\uline{cheatography.com/32070/cs/10383/}}} \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}solsolsol \\ \uline{cheatography.com/solsolsol} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Published 5th January, 2017.\\ Updated 5th 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*}{3} \begin{tabularx}{5.377cm}{p{0.4977 cm} p{0.4977 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Manipulation de fichiers}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{cat}} {\emph{file1...}} : Concatène les files passés en paramètre et les affiche sur stdout (écran)} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{tac}} {\emph{file1...}} : Idem cat mais à l'envers} \tn % Row Count 3 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{\{\{bt\}\}{\bf{cd}} {\emph{path}} : se déplace dans le rep. indiqué} \tn % Row Count 5 (+ 2) % Row 3 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{cd}} : reviens dans le rep. de connexion (home)} \tn % Row Count 6 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{cd}} - : reviens au rep. précédent} \tn % Row Count 7 (+ 1) % Row 5 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{\{\{bt\}\}{\bf{cp}} {\emph{source1... dest}} : Copie source vers dest} \tn % Row Count 9 (+ 2) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{cp -r}} {\emph{dir1... dir2}} :d1 to d2, create d2 if no d2} \tn % Row Count 11 (+ 2) % Row 7 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{-i}}: demande confirmation si écrasement} \tn % Row Count 12 (+ 1) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{-p}} :préserve dates d'accès et de modification} \tn % Row Count 14 (+ 2) % Row 9 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{-r}} : copie récursive} \tn % Row Count 15 (+ 1) % Row 10 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{mv}} : {\emph{file1 file2}} : rename f1 to f2 \& delete f1} \tn % Row Count 17 (+ 2) % Row 11 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{\{\{bt\}\}{\bf{ls}} {[}-aldf{]} {\emph{path1...}} : peut etre file ou dir} \tn % Row Count 19 (+ 2) % Row 12 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{-a}} : liste TOUS les fichiers (hiden...)} \tn % Row Count 20 (+ 1) % Row 13 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{-l}} : format long (taille,date,droits,...)} \tn % Row Count 21 (+ 1) % Row 14 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{-d}} : décrit le dir et non son contenu} \tn % Row Count 22 (+ 1) % Row 15 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{-F}} : format court + type de file (*=exe /=dir)} \tn % Row Count 23 (+ 1) % Row 16 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{-i }} : affiche numéro {\emph{d'inode}} des files} \tn % Row Count 24 (+ 1) % Row 17 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{-R}} : list subdir recursively} \tn % Row Count 25 (+ 1) % Row 18 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{\{\{bt\}\}{\bf{mkdir}} {\emph{path/dir}} : crée un répertoire} \tn % Row Count 26 (+ 1) % Row 19 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{touch}} {\emph{filename}} : crée un fichier} \tn % Row Count 27 (+ 1) % Row 20 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{rm}} {\emph{file/dir-name}}: delete file/dir(-r ou {\bf{rmdir}}) {\bf{-r}} : recursive {\bf{-f}} : force {\bf{-rf}} : both} \tn % Row Count 30 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.4977 cm} p{0.4977 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Echo}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{echo}} {\emph{txt}} : affiche le txt. Méta-char et var d'env ds txt évalué et traduit avt affichage} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{-n}} : supprime saut de ligne} \tn % Row Count 3 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{Guillemets ou apostrophes modifient comp.} \tn % Row Count 4 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{\$ ls\{\{nl\}\} `Modèles Musique a.txt`\{\{nl\}\}\$ echo M*\{\{nl\}\}`Modèles Musique` \{\{nl\}\}\$ echo M* \$fichier\{\{nl\}\}`Modèles Musique a.txt`\{\{nl\}\}\$ echo "M* \$fichier"\{\{nl\}\}`M* a.txt`\{\{nl\}\}\$ echo 'M* \$fichier'\{\{nl\}\}`M* \$fichier`} \tn % Row Count 9 (+ 5) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{echo}} {[}txt{]} \textgreater{} {\emph{file}} : {[}txt{]} into f. If no f, make f} \tn % Row Count 11 (+ 2) % Row 5 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{echo}} {[}txt{]} \textgreater{}\textgreater{} {\emph{file}} : append {[}txt{]} to file} \tn % Row Count 12 (+ 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}{find}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{find}} {\emph{folder1}}... {[}options{]}} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{-empty }} : fichiers vides} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{-name}} {\emph{nom\_fichier}} : f portant {\emph{nom\_fichier}}} \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{\{\{bt\}\}{\bf{-type}} {\emph{type\_fichier}} : f défini sous {\emph{type\_fichier}}\{\{nl\}\}} \tn % Row Count 5 (+ 2) % Row 4 \SetRowColor{LightBackground} & find . {\bf{–type d}} –print (type répertoire)\{\{nl\}\}find . {\bf{–type l}} –print (type lien symbolique)\{\{nl\}\} find . {\bf{-type f}} -print (type normal file) \tn % Row Count 10 (+ 5) % Row 5 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{\{\{bt\}\}{\bf{-newer}} {\emph{nom\_fichier}} :f + récent que {\emph{nom\_f}}} \tn % Row Count 12 (+ 2) % Row 6 \SetRowColor{LightBackground} & find . {\bf{–newer file1}} –print (+ récent que file1) \tn % Row Count 14 (+ 2) % Row 7 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{\{\{bt\}\}{\bf{-size {[}+-{]}}} {\emph{n}} : Recherche par taille. {\bf{-n}} = "inférieur à" {\bf{+n}} = "supérieur à" (bloc 512 o)} \tn % Row Count 17 (+ 3) % Row 8 \SetRowColor{LightBackground} & find . {\bf{–size 4M}} –print (4Mo exactement)\{\{nl\}\}find . {\bf{–size –10G}} –print (+ petit que 10 Go)\{\{nl\}\}find . {\bf{–size +100k}} –print (+ grd que 100 ko) \tn % Row Count 22 (+ 5) % Row 9 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{\{\{bt\}\} {\bf{find . /etc –size +4c –type f –print}} : \{\{nl\}\}Normal file, find in curent and /etc} \tn % Row Count 24 (+ 2) % Row 10 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{find . –perm –7 –type f -print}} : Normal file with {\bf{rwx}} permission, find from curent folder} \tn % Row Count 27 (+ 3) % Row 11 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{\{\{bt\}\}L'option {\bf{-exec}} execute la commande entre {\bf{\{\}}}} \tn % Row Count 29 (+ 2) % Row 12 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{find . -type f -exec file '\{\}' \textbackslash{};}}} \tn % Row Count 30 (+ 1) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{p{0.4977 cm} x{4.4793 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{find (cont)}} \tn % Row 13 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{\{\} remplacés par le nom du fichier trouvé} \tn % Row Count 1 (+ 1) % Row 14 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{cmd exécutée une fois par fichier trouvé} \tn % Row Count 2 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.4977 cm} p{0.4977 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{grep}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{grep}} {[}option{]} `motif` {\emph{file1...}}} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{Affiche chaque ligne des {\emph{file}} contenant le `motif`. Le motif est une expression régulière} \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{-v}} : lignes qui ne contiennent {\bf{pas}} le motif} \tn % Row Count 5 (+ 2) % Row 3 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{-c}} : seulement le nombre de lignes} \tn % Row Count 6 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{-n}} : numéros des lignes trouvées} \tn % Row Count 7 (+ 1) % Row 5 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{-i}} : {\bf{pas}} sensible à la casse} \tn % Row Count 8 (+ 1) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{grep \textless{}motif\textgreater{} \textless{}fichiers\textgreater{}}} : parcourt les f et affiche les lignes qui corresp au motif} \tn % Row Count 10 (+ 2) % Row 7 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{grep erreur *.log }} : affiche les lignes contenant {\bf{erreur}} dans les fichiers *.log} \tn % Row Count 12 (+ 2) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{ grep -i erreur *.log}} : idem + osef casse} \tn % Row Count 13 (+ 1) % Row 9 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{grep -ri erreur . }}: idem + récursif} \tn % Row Count 14 (+ 1) % Row 10 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{grep -v info *.log }} : affiche toutes les lignes des fichiers sauf celles qui contiennent {\bf{info}}} \tn % Row Count 17 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.4977 cm} p{0.4977 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Affichage}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{head}} {[}-n{]} {\emph{file}}: Affiche les n premières lignes} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{tail}} {[}+n | -n{]} {\emph{file}} : La forme tail +n permet d'afficher un fichier à partir de la ligne n. La forme tail -n affiche les n dernières lignes} \tn % Row Count 5 (+ 3) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{more}} {\emph{file}} : affiche page par page} \tn % Row Count 6 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{less}} idem more + revenir en arrière} \tn % Row Count 7 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{man}} {[}n{]} {\emph{cmd}} : affiche page de manuel (n spécifie la section)} \tn % Row Count 9 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.4977 cm} p{0.4977 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Info sur les commandes et fichiers}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{file}} {\emph{file}} : indication sur le type de données contenues dans un fichier. {\bf{(file /usr/bin/ls)}}} \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{type}} {\emph{cmd}} : indique si une cmd possède une implémentation interne. {\bf{(type cd) (type ls)}}} \tn % Row Count 5 (+ 2) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{type}} indique qu'une cmd est interne, mais ne précise pas qu'il existe une implem. ext si il en existe une.} \tn % Row Count 8 (+ 3) % Row 3 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{which}} {\emph{cmd}} Affiche le chemin du fichier exec} \tn % Row Count 9 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{ls}} {\emph{file}} : indique le nom du fichier} \tn % Row Count 10 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.44333 cm} x{3.53367 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Méta-caractères (remplace ...)}} \tn % Row 0 \SetRowColor{LightBackground} * & Suite de caractères. (0 -\textgreater{} max) \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} ? & Un seul caractère quelconque. \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} {[}{]} & Par un des caractère entre crochet. Intervalle : {[}a-zA-Z{]} \tn % Row Count 7 (+ 3) % Row 3 \SetRowColor{white} \{1,2,..,n\} & Remplace par chaque élément de la liste. \tn % Row Count 9 (+ 2) % Row 4 \SetRowColor{LightBackground} \{\{bt\}\}{\bf{ls *.c}} & \{\{bt\}\}files(not folder) that finish with .c \tn % Row Count 11 (+ 2) % Row 5 \SetRowColor{white} {\bf{ls *g}}* & contenant un g \tn % Row Count 12 (+ 1) % Row 6 \SetRowColor{LightBackground} {\bf{ls g}}* & qui commence par un g \tn % Row Count 13 (+ 1) % Row 7 \SetRowColor{white} {\bf{ls *.?}} & . en avant dernier char \tn % Row Count 14 (+ 1) % Row 8 \SetRowColor{LightBackground} {\bf{ls * g??}} & g en avant avant dernier \tn % Row Count 16 (+ 2) % Row 9 \SetRowColor{white} {\bf{ls {[}hg{]}}} & qui commence par h ou g \tn % Row Count 17 (+ 1) % Row 10 \SetRowColor{LightBackground} {\bf{ls {[}hg{]}}}* & contenant soit un h soit un g \tn % Row Count 19 (+ 2) % Row 11 \SetRowColor{white} *.{[}a-z{]}.* & contenant {[}a-z{]} entre deux . \tn % Row Count 20 (+ 1) % Row 12 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{*{[}1-9a-z{]}}}*} \tn % Row Count 21 (+ 1) % Row 13 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{`\$ ls\{\{nl\}\} file\_bsd file\_linux file\_unix\{\{nl\}\}\$ ls file\_\{unix, linux\}\{\{nl\}\}file\_linux file\_unix`} \tn % Row Count 23 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{Pour empêcher interprétation des méta-char par le shell, placer arg entre apostrophes '} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.4977 cm} p{0.4977 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Divers}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{echo {\bf{\$RANDOM}} : return a random number\{\{nl\}\}`for i in \{1..5\}; do echo \$RANDOM; done`} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{/dev/null}} : poubelle. Utile pour y rediriger les sorties indésirables.} \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{/dev/zero }}: Les lectures à partir de ce file renverront des char \textbackslash{}0} \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{/dev/full}} : renvoie une err disque full} \tn % Row Count 7 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{\{\{bt\}\} \textless{}\textless{} est un délimiteur. Le flux d'entrée est directement connecté au flux qui donne la commande. Le délimiteur indique le début et la fin du txt.} \tn % Row Count 11 (+ 4) % Row 5 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{\$ sort -n'\textless{}\textless{} VERGE\{\{nl\}\}\textgreater{}5\{\{nl\}\}\textgreater{}1\{\{nl\}\}\textgreater{}VERGE\{\{nl\}\}1 5} \tn % Row Count 13 (+ 2) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{\{\{bt\}\} {\bf{date}}} \tn % Row Count 14 (+ 1) % Row 7 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{cal}} : affiche un calendrier} \tn % Row Count 15 (+ 1) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{diff}} {\emph{file1 file2}} : compare ligne a ligne 2 files} \tn % Row Count 17 (+ 2) % Row 9 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{wc}} {[}-cwl{]} {\emph{file1...}} : affiche le nombre de \{\{nl\}\} {\bf{-c}} char, {\bf{ -w}}: words, {\bf{-l}} : lignes} \tn % Row Count 19 (+ 2) % Row 10 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{who}} ({[}am i{]}) : liste les users co au système.} \tn % Row Count 20 (+ 1) % Row 11 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{zcat}} {\emph{file1..}} :cat + décomppression} \tn % Row Count 21 (+ 1) % Row 12 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{\{\{bt\}\}{\bf{touch}} {[}-acmt{]} {\emph{fichiers}} : modifie la date d'accès et la dete de modif des fichiers.\{\{nl\}\}} \tn % Row Count 24 (+ 3) % Row 13 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{-a}} :mod l'heure du dernier accès} \tn % Row Count 25 (+ 1) % Row 14 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{-c}} : ne pas créer les fichiers n'existant pas} \tn % Row Count 26 (+ 1) % Row 15 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{-m}} : change l'heure de la der mod du fichier} \tn % Row Count 27 (+ 1) % Row 16 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{\{\{bb\}\}{\bf{-t}} : Use la date indiquée à la place de actual date. arg = nb déci {[}{[}SS{]}AA{]}MMJJhhmm{[}.ss{]}} \tn % Row Count 30 (+ 3) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{p{0.4977 cm} p{0.4977 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Divers (cont)}} \tn % Row 17 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{sort}} {[}-rnu{]} {\emph{file}} : trie les lignes du fichier et écrit le resultat sur l'{\bf{STDOUT}}. {\bf{-r}} : renverse l'rodre du tri, {\bf{-n}} : tri numérique} \tn % Row Count 3 (+ 3) % Row 18 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{\{\{bt\}\} {\bf{tr}} {[}options{]} {\emph{str1}} {\emph{str2}} : recopie {\bf{STDI}} sur {\bf{STDOU}} en remplaçant tout char de str1 par char de position corresp dans str2} \tn % Row Count 6 (+ 3) % Row 19 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{\{\{bt\}\} {\bf{uniq}} {[}-cud{]} {\emph{file}} : check ligne / ligne et détermine les l dupliquées consécutives. \{\{nl\}\} {\bf{-d}} : retient que les lignes dup {\bf{-u}} : retient que l'non-dup {\bf{-c}} : compte l'indice de répét} \tn % Row Count 11 (+ 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}{Contrôle de tâches}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{Unix prend en charge le multi-task préemptif:} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} & -capacité d'un système d'exploitation multitâche à exécuter ou arrêter une tâche planifiée en cours. \tn % Row Count 4 (+ 3) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{"Tout dans Unix est fichier. Tout dans Unix qui n'est pas un fichier est un processus"}}} \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{Processus}}: Instance d'un soft en cours d'exéc. Plusieurs inst d'un même soft peuvent s'exécuter en même temps.} \tn % Row Count 9 (+ 3) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{Données associées aux processus: }}fichiers ouverts, mémoire allouée, pile, id processus, parent, priorité, état...} \tn % Row Count 12 (+ 3) % Row 5 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{\&}} à la fin de la ligne de cmd start une commande en bg.\{\{nl\}\}{\bf{\$ calcul \&\{\{nl\}\}\$ ls -Ral / \textgreater{} ls-Rl.txt \&\{\{nl\}\} \$}}} \tn % Row Count 15 (+ 3) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{2 cmd s'exéc en parallèle, tandis que le shell attend notre prochaine instruction.} \tn % Row Count 17 (+ 2) % Row 7 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{jobs}} : liste des bg task lancées de ce shell\{\{nl\}\}{\bf{\$ jobs\{\{nl\}\} {[}1{]} Running calcul\{\{nl\}\}{[}2{]} Running ls - Ral / \textgreater{} ls-Ral.txt}}\{\{nl\}\}} \tn % Row Count 20 (+ 3) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{Pour kill une tache on utilise le n entre {[}{]}\{\{nl\}\}{\bf{\$ kill {[}-signal{]} \%n}}} \tn % Row Count 22 (+ 2) % Row 9 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{fg}} remet une tache de fond au premier plan} \tn % Row Count 23 (+ 1) % Row 10 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{\textless{}ctrl\textgreater{}-z}} met la tache courante en fond} \tn % Row Count 24 (+ 1) % Row 11 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{sleep n}} : suspend l'exec du process {\bf{n}} sec} \tn % Row Count 25 (+ 1) % Row 12 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{\{\{bt\}\} {\bf{kill}} -{\emph{sig}} PID : Envoie le signal {\emph{sig}} au precess de num PID. {\emph{sig}} peut etre soit le num du signal soit son non. Exemple:} \tn % Row Count 28 (+ 3) % Row 13 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{kill -STOP 1023 = kill -19 1023} \tn % Row Count 29 (+ 1) % Row 14 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{\{\{bt\}\}{\bf{ps}} {[}-e{]}{[}-l{]}{[}aux{]} : affiche la liste des process\{\{nl\}\} {\bf{-l}} plus d'info, {\bf{-e}} process de tous les users {\bf{aux}} : affiche tous les process sur le système} \tn % Row Count 33 (+ 4) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{p{0.4977 cm} x{4.4793 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Contrôle de tâches (cont)}} \tn % Row 15 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{UID: ID du propriétaire du process} \tn % Row Count 1 (+ 1) % Row 16 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{PID: numéro du process} \tn % Row Count 2 (+ 1) % Row 17 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{PPID: PID du père du process} \tn % Row Count 3 (+ 1) % Row 18 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{NI: priorité (nice{[}prio{]}) ({\bf{nice}} {[}-prio{]} cmd)} \tn % Row Count 4 (+ 1) % Row 19 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{S: état du process ({\bf{R}} actif {\bf{S}} bloqué {\bf{Z}} terminé)} \tn % Row Count 6 (+ 2) % Row 20 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{\{\{bt\}\}{\bf{top}} : affiche en continu les process les plus actifs triés par utilisationn CPU.} \tn % Row Count 8 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.4977 cm} p{0.4977 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Tar}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{tar}} {[}options{]} {\emph{fichier ou répertoire}}} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{Permet d'archiver files ou une arborescence de fichiers CAD les regrouper dans 1 file.} \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{tar cvf \textless{}archive\textgreater{} \textless{}fichiers ou répertoires\textgreater{} }}\{\{nl\}\}{\bf{c}} : créer {\bf{v}}: suit progression {\bf{f}}: fichier} \tn % Row Count 6 (+ 3) % Row 3 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{tar tvf \textless{}archive\textgreater{} }} : affiche contenu d;une archive ou vérifie son intégrité ({\bf{t}} : test)} \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{tar xvf \textless{}archive\textgreater{}}}: ext tous les f d'1 archive} \tn % Row Count 9 (+ 1) % Row 5 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{tar xvf \textless{}archive\textgreater{} \textless{}fichiers ou rép.\textgreater{}}} : ext seulement quelques fichiers d'une archive} \tn % Row Count 11 (+ 2) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{Les fichiers ou répertoires sont donnés avec un chemin relatif au répertoire racine de l'archive.}}} \tn % Row Count 14 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.4977 cm} p{0.4977 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{rsync (remote sync)}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{Conçu pour synchroniser des répertoires sur 2 machines reliées par un lien à faible débit.} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{Ne copie que les fichiers qui ont changé. Les fichiers de taille identique sont comparés au moyen de sommes de contrôle.} \tn % Row Count 5 (+ 3) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{Ne transfère que les blocs qui diffèrent au sein d'un fichier} \tn % Row Count 7 (+ 2) % Row 3 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{Peut compresser les blocs transférés} \tn % Row Count 8 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{Conserve les liens symboliques et les permissions sur les fichiers} \tn % Row Count 10 (+ 2) % Row 5 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{Peut fonctionner à travers ssh (shell sécurisé)} \tn % Row Count 11 (+ 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}{Variables d'environnement}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{Le système Unix défini pour chaque process une liste de var d'env pout définir certains paramètres:} \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} & -rép d'installation des utilitaires \tn % Row Count 5 (+ 2) % Row 2 \SetRowColor{LightBackground} & -type de terminal... \tn % Row Count 6 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{Chaque soft peut accéder à ces var pour obtenir des infos sur la config du système} \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{Peut être use dans une cmd. Shell remplace chaque var par sa val avt d'exec la cmd.} \tn % Row Count 10 (+ 2) % Row 5 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{Dans Bash, var d'env sont manip par des cmd} \tn % Row Count 11 (+ 1) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{env}} : liste de toutes les variables} \tn % Row Count 12 (+ 1) % Row 7 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{Variable=valeur }} : donne une val à une variable locale (processus actif)} \tn % Row Count 14 (+ 2) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{export Variable=valeur}} : donne val à une var globale (proces actif + sous-process)} \tn % Row Count 16 (+ 2) % Row 9 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{echo \$Viande}} : affiche val var Viande} \tn % Row Count 17 (+ 1) % Row 10 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{\{\{bt\}\} Pour ajouter une variable de façon permanente, il faut ajouter la ligne {\bf{export nomVar=var}} au fichier {\bf{.bashrc}} dans rep connexion.} \tn % Row Count 20 (+ 3) \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}{Redirection des IO}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{Chaque programme sous UNIX dispose au moins de trois flux de données:} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} & -{\bf{STDIN}}, utilisée en lecture, qui est normalement associée au clavier du terminal. \tn % Row Count 5 (+ 3) % Row 2 \SetRowColor{LightBackground} & -{\bf{STDOUT}}, utilisée en écriture, normalement associée à l'écran du terminal \tn % Row Count 8 (+ 3) % Row 3 \SetRowColor{white} & -{\bf{STDERR}}, utilisée en écriture, pour afficher les messages d'erreur, normalement associée à l'écran du terminal \tn % Row Count 12 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.43873 cm} x{2.53827 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Redirection vers/depuis des fichiers}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{\textgreater{}}} permet de rediriger la sortie standard d'un programme vers un fichier.} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{\$ {\bf{ls}} \textgreater{} {\emph{file}}} \tn % Row Count 3 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{La commande {\bf{ls}} va créer {\emph{file}} et y écrire le résultat de la commande.} \tn % Row Count 5 (+ 2) % Row 3 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{\{\{bb\}\}Pour append à un fichier on utilise \textgreater{}\textgreater{}} \tn % Row Count 6 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{Pour rediriger l'entrée standard, on utilise \textless{}} \tn % Row Count 7 (+ 1) % Row 5 \SetRowColor{white} \$ cat \textless{} UnFichier & more \textless{} fichier.txt \tn % Row Count 8 (+ 1) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{Il est possible de rediriger l'entrée et la sortie en même temps:} \tn % Row Count 10 (+ 2) % Row 7 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{\{\{bb\}\}\$ cat \textless{} fichier.txt \textgreater{} sortie.txt} \tn % Row Count 11 (+ 1) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{\$ ls / 2\textgreater{} error.log}}\{\{nl\}\}Redirige les msg d'erreur} \tn % Row Count 13 (+ 2) % Row 9 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{\$ ls / \textgreater{} fichier.txt 2\textgreater{} error.log}}\{\{nl\}\}stderr dans un file et stdout vers un autre} \tn % Row Count 15 (+ 2) % Row 10 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{\$ ls / \&\textgreater{} fichier.txt}}\{\{nl\}\} stdout et stderr sur le meme fichier} \tn % Row Count 17 (+ 2) % Row 11 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{\$ cat \textless{} input.txt \textgreater{} output.txt 2\textgreater{} error.log}}\{\{nl\}\} Redirection de tous les flux} \tn % Row Count 19 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.4977 cm} p{0.4977 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Redirection vers des tubes (pipe)}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{Redirige la sortie standard d'une commande vers l'entrée standard d'une autre. Les commandes s'exécutent alors en parallèle.} \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{\$ ls | sort -r}} : Affiche le contenu du répertoire trié à l'envers} \tn % Row Count 5 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.4977 cm} p{0.4977 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Séquences de commandes}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{\textless{}commande 1\textgreater{} ; … \textless{} commande n\textgreater{}}}} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{Chaque cmd sera exécutée séquentiellement.} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{\$ echo "Vous êtes le plus beau"; sleep 10; echo " des menteurs"} \tn % Row Count 4 (+ 2) % Row 3 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{\{\{bt\}\}{\bf{\textless{}commande 1\textgreater{} || \textless{}commande 2\textgreater{}}} : OR} \tn % Row Count 5 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{N'exécute la seconde commande que si la première commande échoue.} \tn % Row Count 7 (+ 2) % Row 5 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{\{\{bt\}\}{\bf{\textless{}commande 1\textgreater{} \&\& \textless{}commande 2\textgreater{}}} : AND} \tn % Row Count 8 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.9908 cm} x{2.9862 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Commande tee}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{Envoie en même temps stdout vers un fichier et vers l'écran.} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} {\bf{tee}} {[}-a{]} {\emph{file}} & -a : append {[}CTRL{]}+c to exit \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{make | {\bf{tee}} build.log\{\{nl\}\} Lance make et stocke sa sortie dans build.log} \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{make install | {\bf{tee}} -a build.log\{\{nl\}\}Lance la commande make install et rajoute sa sortie à la fin du fichier build.log} \tn % Row Count 9 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.4977 cm} p{0.4977 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Commande yes}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{yes}} \textless{}string\textgreater{} | \textless{}command\textgreater{} \{\{nl\}\}Remplit l'entrée standard de \textless{}command\textgreater{} avec \textless{}string\textgreater{} (y par défaut)} \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{yes}} | rm -r dir/} \tn % Row Count 4 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{yes}} {\emph{no}} | credit\_applicant} \tn % Row Count 5 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{yes}} "" | make oldconfig} \tn % Row Count 6 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{Equivaut à appuyer sur Entrer pour accepter les paramètres par défaut.} \tn % Row Count 8 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Commande Internes}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{p{5.377cm}}{\vspace{1px}\centerline{\includegraphics[width=5.1cm]{/web/www.cheatography.com/public/uploads/solsolsol_1483551373_interne.png}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{-intégrée au processus shell \newline -ne correspond pas à un fichier sur le disque \newline -exécutée par le shell courant} \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}{Commande Externes}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{p{5.377cm}}{\vspace{1px}\centerline{\includegraphics[width=5.1cm]{/web/www.cheatography.com/public/uploads/solsolsol_1483551243_externe.png}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{fichier localisé dans l'arborescence avec l'un des format suivants: \newline -binaire exécutable \newline -txt représentant un script (Shell, python...)} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.4977 cm} p{0.4977 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Commandes Internes et Externes}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{Certaines commandes ont une implémentation interne et externe. La {\bf{cmd interne}} est lancée en prio car son exec est plus rapide.} \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{pwd}} = cmd interne et externe} \tn % Row Count 4 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{Pour forcer exec cmd externe, indiquer l'emplacement de la cmd ext.} \tn % Row Count 6 (+ 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}{Substitution de commande}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{Syntaxe: {\bf{\$(cmd) }}} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{Une commande {\bf{cmd}} entourée par des {\bf{parenthèses}} précédées d'un caractère {\bf{\$}} est :} \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} & 1. exécutée par le shell \tn % Row Count 4 (+ 1) % Row 3 \SetRowColor{white} & 2. la chaine \$(cmd) est remplacée par les résultats de la commande \tn % Row Count 6 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.4977 cm} p{0.4977 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Scripts}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{Langage interprété (shell, python...)} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{First ligne starts with {\bf{\#!}} + path interpretor} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{chmod}} transforme un fichier txt en exec} \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{\$ chmod a+x }} {\emph{script}}} \tn % Row Count 4 (+ 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}{Contexte}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{G}}NU is {\bf{N}}ot {\bf{U}}nix: 1984 Richard Stallman projet système {\bf{à la Unix}} entièrement libre.} \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{Les logiciels libres offre ces 4 libertés:} \tn % Row Count 4 (+ 1) % Row 2 \SetRowColor{LightBackground} & -d'exéc soft, qu'elle que soit le but \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} & -étudier fonctionn, et de l'adapt à ses needs \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} & -redistribuer des copies pour aider autrui \tn % Row Count 10 (+ 2) % Row 5 \SetRowColor{white} & -améliorer soft, et share ses améliorations \tn % Row Count 12 (+ 2) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{Licence {\bf{G}}eneral {\bf{P}}ublic {\bf{L}}icence (soft libre):} \tn % Row Count 14 (+ 2) % Row 7 \SetRowColor{white} & toute modif soft libre reste soft libre \tn % Row Count 16 (+ 2) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{Linux}}: 1991 Linus Torvald. Noyau libre semblable au noyau Unix utilisant outils GNU\{\{nl\}\}=\textgreater{}Système complet = {\bf{GNU/Linux}} (soft libre)} \tn % Row Count 19 (+ 3) % Row 9 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{Noyaux}} = Kernel: cœur du système, fournit aux softs une interface de programmation pour utiliser le matériel.} \tn % Row Count 22 (+ 3) % Row 10 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{Distrib}} Linux(ab de lang)=distrib GNU/Linux\{\{nl\}\}ensemble cohérent de logiciels assemblés autour du noyau Linux.\{\{nl\}\}Distribution(ang)=collection de logiciels(fr) = système GNU/Linux.} \tn % Row Count 26 (+ 4) % Row 11 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{Distrib comm.}}: assistance technique. Le code source libre, mais pas les binaires. (Red hat, Suse, Mandriva...)} \tn % Row Count 29 (+ 3) % Row 12 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{Distrib commun.}}: sources + bin sont libres mais pas forcément d'assistance technique. (Fedora Core, Ubuntu Linux, Debian...)} \tn % Row Count 32 (+ 3) \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}{Outils}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{Tout système UNIX inclut:} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} & -compilateur C \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} & -interpréteurs de commandes (shells) \tn % Row Count 4 (+ 2) % Row 3 \SetRowColor{white} & -commandes de manipulation de fichiers \tn % Row Count 6 (+ 2) % Row 4 \SetRowColor{LightBackground} & -Editeurs de texte \tn % Row Count 7 (+ 1) % Row 5 \SetRowColor{white} & -Outils de dév (compilateur, débogueurs, analyseurs lexicaux et syntax...) \tn % Row Count 10 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.4977 cm} p{0.4977 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Shell}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{Interpréteur de commande en mode texte. Il peut s'utiliser en mode interactif ou pour exec des soft écrit en {\bf{shell scripts}}.} \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{Bash:}} Bourn Again SHell (standard) probablement le shell le plus utilisé avec {\bf{Ksh}}} \tn % Row Count 5 (+ 2) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{Bourn Shell (sh) : 1970 by Steve Bourne. Shell le plus ancien (maybe). Bash est issu d'innovations sur ce dernier.} \tn % Row Count 8 (+ 3) \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}{Systèmes de gestion de fichiers}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{SGF=système de fichiers=FS =File System:} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} & -Façon de stocker data et de les organiser dans des fichiers sur des mémoires second \tn % Row Count 4 (+ 3) % Row 2 \SetRowColor{LightBackground} & -Permet de traiter, conserver data +share entre programmes informatiques \tn % Row Count 7 (+ 3) % Row 3 \SetRowColor{white} & -Offre à l'user vue abstraite sur ses data + permet de les localiser à partir d'un path. \tn % Row Count 10 (+ 3) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{Concepts:} \tn % Row Count 11 (+ 1) % Row 5 \SetRowColor{white} & -fichier: {\bf{niveau logique}} (organisation visuelle dans le browser de fichiers) \tn % Row Count 14 (+ 3) % Row 6 \SetRowColor{LightBackground} & -Enregistrement(sur périf): {\bf{niveau physique}}: organisation sur le périphérique de stockage \tn % Row Count 17 (+ 3) % Row 7 \SetRowColor{white} \seqsplit{Microsoft:} & FAT, NTFS \tn % Row Count 19 (+ 2) % Row 8 \SetRowColor{LightBackground} Apple: & HFS \tn % Row Count 20 (+ 1) % Row 9 \SetRowColor{white} Linux: & ReiserFS, ext3, ext4\{\{nl\}\} {\emph{chaque fichier est caractérisé par un nom qui permet de repérer les data associées store sur un perif. \textbackslash{}n interdit dans le nom}} \tn % Row Count 25 (+ 5) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.4977 cm} p{0.4977 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Répertoires}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{Les fichiers sont organisés en répertoires et en sous-rep formant une arborescence.} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{Au moins 2 fichiers/répertoire: . et ..} \tn % Row Count 3 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{(.) référence le répertoire lui meme.} \tn % Row Count 4 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{(..) permet d'accéder au répertoire parent (\textasciicircum{})} \tn % Row Count 5 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{La racine de l'arbre est /} \tn % Row Count 6 (+ 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}{Structure de fichiers GNU/Linux}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{Peut varier d'un système à l'autre!} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} / & Répertoire racine \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} /bin & Commandes de base du système \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} /boot & Noyau et fichiers de configuration \tn % Row Count 5 (+ 2) % Row 4 \SetRowColor{LightBackground} /dev & Fichiers représentant des périph. \tn % Row Count 6 (+ 1) % Row 5 \SetRowColor{white} /etc & Fichiers de configuration du sys. \tn % Row Count 7 (+ 1) % Row 6 \SetRowColor{LightBackground} /home & Répertoire utilisteurs \tn % Row Count 9 (+ 2) % Row 7 \SetRowColor{white} /lib & Bibliothèques de base du système \tn % Row Count 10 (+ 1) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{/lost+found\{\{nl\}\}Files détériorés que le sys. a essayé de récup.} \tn % Row Count 12 (+ 2) % Row 9 \SetRowColor{white} /mnt & Sys. de fich montés `/mnt/usbdik/,...` \tn % Row Count 14 (+ 2) % Row 10 \SetRowColor{LightBackground} /proc & Accès info sys.\{\{nl\}\}`/proc/cpuinfo, /proc/version,...` \tn % Row Count 16 (+ 2) % Row 11 \SetRowColor{white} /root & Répertoire utilisateur de l'admin \tn % Row Count 18 (+ 2) % Row 12 \SetRowColor{LightBackground} /sbin & Commandes admin \tn % Row Count 20 (+ 2) % Row 13 \SetRowColor{white} /sys & Contrôle sys. et périph. (frq cpu...) \tn % Row Count 22 (+ 2) % Row 14 \SetRowColor{LightBackground} /tmp & Temp files \tn % Row Count 23 (+ 1) % Row 15 \SetRowColor{white} /usr & Users soft, non essentiels au sys. \tn % Row Count 24 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.73926 cm} p{0.4577 cm} x{2.38004 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{5.377cm}}{\bf\textcolor{white}{Path}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{3}{x{5.377cm}}{Un fichier qui commence par / est dit {\bf{absolu:}}\{\{nl\}\}cd \seqsplit{/home/user/sol/viande.txt}} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \mymulticolumn{3}{x{5.377cm}}{Un fichier qui ne commence pas par / est {\bf{relatif}} et est interprété en partant du répertoire courant: cd ../../Bureau/boule.txt} \tn % Row Count 5 (+ 3) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{3}{x{5.377cm}}{Un nom de de fichier qui commence par \textasciitilde{} spécifie un chemin de type {\bf{user}}. Interprété from curent user folder.} \tn % Row Count 8 (+ 3) % Row 3 \SetRowColor{white} \mymulticolumn{3}{x{5.377cm}}{\{\{bb\}\}Si \textasciitilde{} suivi d'un username: Interprété en partant du répertoire perso de l'utilisateur spécifié.} \tn % Row Count 11 (+ 3) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{3}{x{5.377cm}}{{\bf{\textasciitilde{}}} correspond à /home/sol} \tn % Row Count 12 (+ 1) % Row 5 \SetRowColor{white} {\bf{cd \textasciitilde{}}} & = & cd /home/sol \tn % Row Count 13 (+ 1) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{3}{x{5.377cm}}{\{\{bt\}\}Chaque user connu du sys. a un {\bf{home}} directory = courant @ start bash.} \tn % Row Count 15 (+ 2) % Row 7 \SetRowColor{white} \mymulticolumn{3}{x{5.377cm}}{{\bf{cd}} sans argument nous envoie au {\bf{home}} dir} \tn % Row Count 16 (+ 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}{Types de fichiers}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{Fichiers:}}} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} & -contiennent des données \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} & -UNIX ne fait aucune différence entre les fichiers de texte et les fichiers binaires \tn % Row Count 5 (+ 3) % Row 3 \SetRowColor{white} & -dans un txt, les lignes sont séparés par {\bf{\textbackslash{}n}} \tn % Row Count 7 (+ 2) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{Répertoires:}} contiennent une liste de reférences à d'autres fichiers UNIX.} \tn % Row Count 9 (+ 2) % Row 5 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{Fichiers spéciaux:}} associés à des pilotes de périphériques.} \tn % Row Count 11 (+ 2) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{Tubes et sockets:}} utilisés pour la com. entre process.} \tn % Row Count 13 (+ 2) % Row 7 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{Liens symboliques:}} fichiers "pointant" sur un autre fichier.} \tn % Row Count 15 (+ 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}{Droits d'accès}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{File users sont divisés en 3 ensembles:} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} & –le propriétaire du fichier \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} & -users du même groupe de travail que prop. \tn % Row Count 4 (+ 2) % Row 3 \SetRowColor{white} & -les autres users ayant accès au système \tn % Row Count 6 (+ 2) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{User from one of those groups à accès ou non au fichier en: read({\bf{r}}), write({\bf{w}}), exec({\bf{x}}).} \tn % Row Count 9 (+ 3) % Row 5 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{Ces droits (ou permissions) d'accès ne peuvent être changés que par le propriétaire du fichier, grâce à la commande {\bf{chmod}}} \tn % Row Count 12 (+ 3) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{\{\{bt\}\} \$ ls -l pol.tex\{\{nl\}\}`-rwxr-{}-{}-{}-- 1 sol users 67504 Mar 25 23:29 pol.tex`} \tn % Row Count 14 (+ 2) % Row 7 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{Le fichier {\bf{pol.tex}}:} \tn % Row Count 15 (+ 1) % Row 8 \SetRowColor{LightBackground} & -contient 67504 char \tn % Row Count 16 (+ 1) % Row 9 \SetRowColor{white} & -appartient à l'user sol \tn % Row Count 17 (+ 1) % Row 10 \SetRowColor{LightBackground} & -fait partie du groupe users \tn % Row Count 18 (+ 1) % Row 11 \SetRowColor{white} & -date et heure dernière modification \tn % Row Count 20 (+ 2) % Row 12 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{-rwxr-{}-{}-{}--}}:} \tn % Row Count 21 (+ 1) % Row 13 \SetRowColor{white} - & type de fichier (fichier ordinaire) \tn % Row Count 22 (+ 1) % Row 14 \SetRowColor{LightBackground} rwx & droits du propriétaire du file \tn % Row Count 23 (+ 1) % Row 15 \SetRowColor{white} r-{}- & droit users meme grp. que owner \tn % Row Count 24 (+ 1) % Row 16 \SetRowColor{LightBackground} -{}-{}- & droits des autres users \tn % Row Count 25 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.4977 cm} p{0.4977 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Liens symboliques}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{Fichier est une référence au nom d'un autre (fichier ou répertoire)} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{ln}} -s {\emph{file}} {\emph{symbole}} : crée un lien symbolique} \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{ln}} -s {\emph{file1, file2 ...}} Rep\_dest\_shortcut: crée un "raccourcis" des files dans le Rep\_dest} \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{rm}} {\emph{symbole}} : ne del que le symbole} \tn % Row Count 7 (+ 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}{Liens physiques}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{p{5.377cm}}{\vspace{1px}\centerline{\includegraphics[width=5.1cm]{/web/www.cheatography.com/public/uploads/solsolsol_1483620599_lien_phys.png}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{-Par défaut, ln crée des liens physiques \newline -Les liens physiques sont indiscernables des fichiers d'origine \newline -Si fichier d'origine supprimé, cela n'affecte pas le contenu du lien physique \newline -Contenu est supprimé si il n'y a plus aucun fichier (lien physique) qui y fait référence} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.4977 cm} p{0.4977 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Alias}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{Raccourcis pour les commandes} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{alias ls='ls -la'}}} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{ alias rm='rm -i' }}} \tn % Row Count 3 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}