diff --git a/Makefile b/Makefile index aee005dc0894932a1d5cb6e4d0ebea2e5b271309..c6f84c45fcd3bdea41342c7a8927f65ff74aa82c 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ HTMLOPTIONS += -t html5 HTMLOPTIONS += -c css/tufte-css/tufte.css HTMLOPTIONS += --self-contained -all: delaunay.pdf pointeurs_avances.pdf oral.pdf ligne_commande.pdf strings.pdf tests_assertions.pdf make.pdf base_3.pdf base_2.pdf base_1.pdf intro.pdf index.html +all: command_line.pdf delaunay.pdf pointeurs_avances.pdf oral.pdf ligne_commande.pdf strings.pdf tests_assertions.pdf make.pdf base_3.pdf base_2.pdf base_1.pdf intro.pdf index.html intro.pdf: intro.md metadata.yaml pandoc $(PDFOPTIONS) -o $@ $^ @@ -42,7 +42,10 @@ oral.pdf: oral.md metadata.yaml pointeurs_avances.pdf: pointeurs_avances.md metadata.yaml pandoc $(PDFOPTIONS) -o $@ $^ -delaunay.pdf: delaunay.md +delaunay.pdf: delaunay.md metadata.yaml + pandoc $(PDFOPTIONS) -o $@ $^ + +command_line.pdf: command_line.md metadata.yaml pandoc $(PDFOPTIONS) -o $@ $^ index.html: index.md diff --git a/command_line.md b/command_line.md new file mode 100644 index 0000000000000000000000000000000000000000..d42991d30dc8f103404f16c00a7efec99d2f5033 --- /dev/null +++ b/command_line.md @@ -0,0 +1,111 @@ +% Introduction à la l'interface en ligne de commande +% O. Malaspinas +% 16 septembre 2020 + +# Introduction + +## Généralités + +* *Command line interface* (CLI) en anglais. +* Interface textuelle vers l'ordinateur. +* Peut s'appeler le *shell*, le *terminal*, la *console*, ... +* Semble obscure, mais est très pratique (automatisation de tâches, copier-coller, ...). +* Vous devrez l'utiliser tout au long de vos études. +* Existe sous Linux, MacOS, et même Windows (les commandes peuvent varier!). +* Ici on ne parlera que de *Linux*. + +# A quoi ça sert? + +## Équivalent textuel d'un GUI + +Toutes les informations obtenues avec une interface graphique, peuvent être obtenues à l'aide de la ligne de commande (liste loin d'être exhaustive): + +* Changement d'un répertoire: `cd`{.bash} +* Affichage du contenu d'un répertoire: `ls` +* Déplacement de fichier: `mv` +* Copie de fichier: `cp` +* Création de répertoire: `mkdir` +* Recherche de fichier: `find` +* Recherche de texte dans un fichier: `grep` +* Etc, etc, etc, etc, etc + +## Mais aussi + +* Télécharger des documents, compiler, éditer des fichiers, ... + +# Ouvrir un terminal + +Dépendant de votre distribution de Linux l'ouverture d'un terminal peut varier. + +Ce qui marche *presque* tout le temps: + +1. Appuyer sur le bouton `Super` (`Windows`) du clavier. +2. Commencer à taper "terminal". + +{#fig:terminal_open width=100%} + +Raccourcis clavier: + +* `Ctrl+Alt+T` +* `Super+T` +* Vous pouvez customiser les raccourcis. + +# Une fois le terminal ouvert + +Vous pouvez taper des commandes puis `Entrée`. + +```bash +$ pwd +/home/orestis +``` + +Exemple: `pwd` affiche le répertoire courant (**p**rint **w**orking **d**irectory). + +**Attention: les commandes sont sensibles à la casse!** + +Exemple: `cd` change de répertoire (**c**hange **d**irectory). + +:::::::::::::: {.columns} + +::: {.column width="45%"} + +```bash +$ pwd +/home/orestis +$ cd .. +$ pwd +/home +``` + +::: +::: {.column width="45%"} + +```bash +$ cd orestis +$ pwd +/home/orestis +$ cd ../.. +$ pwd +/ +``` + +::: +:::::::::::::: + +# Remarque: chemins relatifs ou absolus + +Lorsqu'on spécifie un *chemin* + +# Quelques commandes utiles + +## `ls` + + + +## `mkdir` + + + + + + diff --git a/figs/terminal_open.png b/figs/terminal_open.png new file mode 100644 index 0000000000000000000000000000000000000000..16bd9c85f6380b34bb9c46c2286831ae9bb66ab2 Binary files /dev/null and b/figs/terminal_open.png differ diff --git a/intro.md b/intro.md index e4ba3ebb79f70cd80576ad8fb920c2cfdfd2c0a3..f1d705abcae78e6f571b1c75fb5a13a30fc5d2f0 100644 --- a/intro.md +++ b/intro.md @@ -87,7 +87,7 @@ Tout le contenu de ce qu'on raconte se trouve sur cyberlearn: # Questions? -- N'hésitez pas à poser des *questions*, nous sommes là pour ça![^1] +- N'hésitez pas à poser des *questions*, nous sommes là pour ça! [^1] - N'hésitez pas à faire des *retours*: *négatifs* ou *positifs*. [^1]: Chaque étudiant·e·s a un quota de 5 questions par semestre.