Bonjour,
Est-il possible d'avoir une liste avec descriptions des commandes dans le man BASH comme en DOS si dessous ?
Merci
Bonjour,
Est-il possible d'avoir une liste avec descriptions des commandes dans le man BASH comme en DOS si dessous ?
Merci
salut,
c'est à dire que bash c'est un peu plus poussé que command.com ou cmd.exe, t'as man bash qui te permet de consulter la doc, et en général dans ton afficheur tu as moyen de faire des recherches, par exemple en tapant "/toto" tu vas chercher la première occurrence de "toto", "n" permettra de trouver les suivantes, "shift-n" les précédentes, "pgup/pgdown" de monter/descendre d'une page etc. partant de là t'as souvent moyen de trouver ton bonheur moyennant des recherches avisées
si la question c'est simplement de savoir si y'a moyen de faire tenir la doc bash sur une fiche bristol la réponse est non, après tu peux toujours être sélectif, de la même manière que le terme "tutorial" est devenu un mot clé dans les recherches internet, le mot "cheatsheet" (antisèche) permet de cibler des fiches "pense-bête"
ainsi google "bash cheatsheet" renvoit vers des trucs comme ça :
Ok BufferBob et merci pour les cheatsheet !
aussi j'avais complètement oublié, tu peux simplement taper help, ça donne pas de description réelle mais une espèce de récap :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47 GNU bash, version 4.3.42(4)-release (i686-pc-cygwin) Ces commandes de shell sont définies de manière interne. Saisissez « help » pour voir cette liste. Tapez « help nom » pour en savoir plus sur la fonction qui s'appelle « nom ». Utilisez « info bash » pour en savoir plus sur le shell en général. Utilisez « man -k » ou « info » pour en savoir plus sur les commandes qui ne font pas partie de cette liste. Une astérisque (*) à côté d'un nom signifie que la commande est désactivée. job_spec [&] history [-c] [-d décalage] [n] ou hi> (( expression )) if COMMANDES; then COMMANDES; [ elif> . nom_fichier [arguments] jobs [-lnprs] [jobspec ...] ou jobs > : kill [-s sigspec | -n signum | -sigs> [ arg... ] let arg [arg ...] [[ expression ]] local [option] nom[=valeur] ... alias [-p] [nom[=valeur] ... ] logout [n] bg [job_spec ...] mapfile [-n nombre] [-O origine] [-s> bind [-lpsvPSVX] [-m keymap] [-f file> popd [-n] [+N | -N] break [n] printf [-v var] format [arguments] builtin [shell-builtin [arg ...]] pushd [-n] [+N | -N | rép] caller [expr] pwd [-LP] case MOT in [MOTIF [| MOTIF]...) COMM> read [-ers] [-a tableau] [-d delim] > cd [-L|[-P [-e]] [-@]] [dir] readarray [-n nombre] [-O origine] [> command [-pVv] commande [arg ...] readonly [-aAf] [nom[=valeur] ...] o> compgen [-abcdefgjksuv] [-o option] > return [n] complete [-abcdefgjksuv] [-pr] [-DE] > select NOM [in MOTS ... ;] do COMMAN> compopt [-o|+o option] [-DE] [nom ...> set [-abefhkmnptuvxBCHP] [-o nom-opt> continue [n] shift [n] coproc [NOM] commande [redirections] shopt [-pqsu] [-o] [nom_opt ...] declare [-aAfFgilnrtux] [-p] [name[=v> source nom_fichier [arguments] dirs [-clpv] [+N] [-N] suspend [-f] disown [-h] [-ar] [jobspec ...] test [expr] echo [-neE] [arg ...] time [-p] pipeline enable [-a] [-dnps] [-f nomfichier] [> times eval [arg ...] trap [-lp] [[arg] signal_spec ...] exec [-cl] [-a nom] [commande [argume> true exit [n] type [-afptP] nom [nom ...] export [-fn] [nom[=valeur] ...] ou ex> typeset [-aAfFgilrtux] [-p] nom[=val> false ulimit [-SHabcdefilmnpqrstuvxT] [lim> fc [-e ename] [-lnr] [premier] [derni> umask [-p] [-S] [mode] fg [job_spec] unalias [-a] nom [nom ...] for NOM [in MOTS ... ] ; do COMMANDES> unset [-f] [-v] [-n] [name ...] for (( exp1; exp2; exp3 )); do COMMAN> until COMMANDES; do COMMANDES; done function nom { COMMANDES ; } ou nom (> variables - Nom et signification de > getopts chaineopts nom [arg] wait [-n] [id ...] hash [-lr] [-p nomchemin] [-dt] [nom > while COMMANDES; do COMMANDES; done help [-dms] [motif ...] { COMMANDES ; }
pour aller plus loin, et obtenir un aperçu de tous les Programmes exécutables ou commandes de l'interpréteur de commandes (shell) :ça dépasse de beaucoup l'interpréteur de commande !
Code : Sélectionner tout - Visualiser dans une fenêtre à part man -s1 -k '.*' | sort | less
Salut,
Pour obtenir le même affichage concernant les commandes primitives (ou des mots clés) du shell, essaies ça :
Ce qui renvoie :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6 #! /bin/bash while read line do help -d "${line}" 2>/dev/null done < <(help | grep -Po '(^ {1}\K[^ ]*)|( {2,}\K[^ ]*)' | sort)
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75 : - Null command. . - Execute commands from a file in the current shell. (( ... )) - Evaluate arithmetic expression. [ - Evaluate conditional expression. [[ ... ]] - Execute conditional command. { ... } - Group commands as a unit. alias - Define or display aliases. bg - Move jobs to the background. bind - Set Readline key bindings and variables. break - Exit for, while, or until loops. builtin - Execute shell builtins. caller - Return the context of the current subroutine call. case - Execute commands based on pattern matching. cd - Change the shell working directory. command - Execute a simple command or display information about commands. compgen - Display possible completions depending on the options. complete - Specify how arguments are to be completed by Readline. compopt - Modify or display completion options. continue - Resume for, while, or until loops. coproc - Create a coprocess named NAME. declare - Set variable values and attributes. dirs - Display directory stack. disown - Remove jobs from current shell. echo - Write arguments to the standard output. enable - Enable and disable shell builtins. eval - Execute arguments as a shell command. exec - Replace the shell with the given command. exit - Exit the shell. export - Set export attribute for shell variables. false - Return an unsuccessful result. fc - Display or execute commands from the history list. fg - Move job to the foreground. for - Execute commands for each member in a list. for - Execute commands for each member in a list. function - Define shell function. getopts - Parse option arguments. hash - Remember or display program locations. help - Display information about builtin commands. history - Display or manipulate the history list. if - Execute commands based on conditional. jobs - Display status of jobs. kill - Send a signal to a job. let - Evaluate arithmetic expressions. local - Define local variables. logout - Exit a login shell. mapfile - Read lines from the standard input into an indexed array variable. popd - Remove directories from stack. printf - Formats and prints ARGUMENTS under control of the FORMAT. pushd - Add directories to stack. pwd - Print the name of the current working directory. read - Read a line from the standard input and split it into fields. readarray - Read lines from a file into an array variable. readonly - Mark shell variables as unchangeable. return - Return from a shell function. select - Select words from a list and execute commands. set - Set or unset values of shell options and positional parameters. shift - Shift positional parameters. shopt - Set and unset shell options. source - Execute commands from a file in the current shell. suspend - Suspend shell execution. test - Evaluate conditional expression. time - Report time consumed by pipeline's execution. times - Display process times. trap - Trap signals and other events. true - Return a successful result. type - Display information about command type. typeset - Set variable values and attributes. ulimit - Modify shell resource limits. umask - Display or set file mode mask. unalias - Remove each NAME from the list of defined aliases. unset - Unset values and attributes of shell variables and functions. until - Execute commands as long as a test does not succeed. variables - Common shell variable names and usage. wait - Wait for job completion and return exit status. while - Execute commands as long as a test succeeds.![]()
Il y a aussi "apropos":
équivalent de "man -s 1 -k '.*'" déjà suggéré (que l'on peut simplifier en "man -s 1 -k .").
Code : Sélectionner tout - Visualiser dans une fenêtre à part $ apropos -s 1 .
@zipe31
Wouahh ! Fallait le trouver celui-là de script. La même que help mais en super propre.
Dommage qu'ils est pas penser à faire ça avec une commande plus simple.
Merci et à BufferBob aussi
@N_BaH
C'est super ça aussi merci ! J'ai tout d'un coup.
Dommage que les programmes et les commandes soient mélangés.
@jlliagre
Merci c'est complémentaire.
@hipokamp : Rajoute '-u' à sort pour éviter les doublons![]()
Yep !
Je me mêle de ce qui ne me regarde pas, mais chez moi ça ne change rien :
Pb de version des coreutils (8.12.197 de sept. 2011) ? Ou de Bash (4.2.37) ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11 ... time - Report time consumed by pipeline''s execution. times - Display process times. times - Display process times. trap - Trap signals and other events. true - Return a successful result. type - Display information about command type. typeset - Set variable values and attributes. typeset - Set variable values and attributes. ulimit - Modify shell resource limits. ...
@Jipété : Essaye avec uniq : help | grep -Po '(^ {1}\K[^ ]*)|( {2,}\K[^ ]*)' | sort | uniq
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13 $ bash --version GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu) $ apt-cache policy coreutils coreutils: Installé*: 8.21-1ubuntu5.3 Candidat*: 8.21-1ubuntu5.3 $ lsb_release -a Distributor ID: LinuxMint Description: Linux Mint 17.3 Rosa Release: 17.3 Codename: rosa
Io !
Truc de ouf !
Que ce soit avec sort -u ou ... sort | uniq le résultat est toujours le même, avec les doublons, tel que je l'ai donné en fin de journée.
Par contre, hors script, juste la string quotée ci-dessus, pas besoin de uniq ou de -u, y a de doublon...
Bon, on va pas passer la nuit là-dessus, au plus ça va au plus j'ai l'impression que l'informatique n'est pas une science exacte, malgré ce qu'on pourrait croire...![]()
Bonjour,
Perso, j'ai plus court, mais c'est peut-être un effet de bord (et ça me permet d'avoir par exemple les 2 variantes de for:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77 $ help -d '' % - Resume job in foreground. (( ... )) - Evaluate arithmetic expression. . - Execute commands from a file in the current shell. : - Null command. [ - Evaluate conditional expression. [[ ... ]] - Execute conditional command. alias - Define or display aliases. bg - Move jobs to the background. bind - Set Readline key bindings and variables. break - Exit for, while, or until loops. builtin - Execute shell builtins. caller - Return the context of the current subroutine call. case - Execute commands based on pattern matching. cd - Change the shell working directory. command - Execute a simple command or display information about commands. compgen - Display possible completions depending on the options. complete - Specify how arguments are to be completed by Readline. compopt - Modify or display completion options. continue - Resume for, while, or until loops. coproc - Create a coprocess named NAME. declare - Set variable values and attributes. dirs - Display directory stack. disown - Remove jobs from current shell. echo - Write arguments to the standard output. enable - Enable and disable shell builtins. eval - Execute arguments as a shell command. exec - Replace the shell with the given command. exit - Exit the shell. export - Set export attribute for shell variables. false - Return an unsuccessful result. fc - Display or execute commands from the history list. fg - Move job to the foreground. for - Execute commands for each member in a list. for (( - Arithmetic for loop. function - Define shell function. getopts - Parse option arguments. hash - Remember or display program locations. help - Display information about builtin commands. history - Display or manipulate the history list. if - Execute commands based on conditional. jobs - Display status of jobs. kill - Send a signal to a job. let - Evaluate arithmetic expressions. local - Define local variables. logout - Exit a login shell. mapfile - Read lines from the standard input into an indexed array variable. popd - Remove directories from stack. printf - Formats and prints ARGUMENTS under control of the FORMAT. pushd - Add directories to stack. pwd - Print the name of the current working directory. read - Read a line from the standard input and split it into fields. readarray - Read lines from a file into an array variable. readonly - Mark shell variables as unchangeable. return - Return from a shell function. select - Select words from a list and execute commands. set - Set or unset values of shell options and positional parameters. shift - Shift positional parameters. shopt - Set and unset shell options. source - Execute commands from a file in the current shell. suspend - Suspend shell execution. test - Evaluate conditional expression. time - Report time consumed by pipeline's execution. times - Display process times. trap - Trap signals and other events. true - Return a successful result. type - Display information about command type. typeset - Set variable values and attributes. ulimit - Modify shell resource limits. umask - Display or set file mode mask. unalias - Remove each NAME from the list of defined aliases. unset - Unset values and attributes of shell variables and functions. until - Execute commands as long as a test does not succeed. variables - Common shell variable names and usage. wait - Wait for job completion and return exit status. while - Execute commands as long as a test succeeds. { ... } - Group commands as a unit.
Bonjour
Juste pour comparer:
Je n'ai pas "times" en double, mais j'ai "for" en double.
Et le sort -u au lieu de sort règle le problème.
Pour le coup, c'est à mon chat que l'on doit du respect, c'est lui qui m'a fait découvrir ce raccourci en sautant sur mon clavier au moment opportun
![]()
À ce rythme, on va bientôt lui attribuer la paternité du shabang aussi
![]()
Partager