type
Processus et système
Syntaxe
type [-a] <name>Demande au shell lui-meme ce qu'est vraiment un nom : alias, fonction, commande interne ou fichier, exactement ce que `which` ne peut pas voir puisqu'il ne regarde que PATH.
Options courantes
| Option | Signification |
|---|---|
| -a | Every meaning of the name, in the order the shell would consider them. |
| -t | One word only: alias, keyword, function, builtin or file. |
| -P | Force a PATH lookup even if the name is also an alias or function (bash). |
| -f | Ignore shell functions. |
Exemples
type -a lsReveals the alias first and the /bin/ls binary second.
type -t rmPrints "file" if nothing is shadowing it, "alias" if something is.
Ce qui tourne et ce qui mange la machine. Identifier vient avant tuer.
Comment lire
- Les crochets [ ] marquent une partie facultative.
- Les points de suspension … signifient qu’on peut en mettre plusieurs.
- Les options sont sensibles à la casse : sur certaines commandes, -r et -R ne font pas la même chose.
Questions fréquentes
Q. Que fait type ?
Demande au shell lui-meme ce qu'est vraiment un nom : alias, fonction, commande interne ou fichier, exactement ce que `which` ne peut pas voir puisqu'il ne regarde que PATH.
Q. Comment l’écrire ?
type [-a] <name> — les crochets marquent ce qui est facultatif.
Q. Combien d’options valent la peine ?
Il y en a 4 ici ; la liste complète est dans man type. Cette commande relève de Processus et système.
Commandes liées
page man: man type