informatique:linux:commandes_linux
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
informatique:linux:commandes_linux [2021/07/30 13:40] – pteu | informatique:linux:commandes_linux [2021/08/23 08:27] – [printf] pteu | ||
---|---|---|---|
Line 2077: | Line 2077: | ||
</ | </ | ||
+ | =====printf===== | ||
+ | |||
+ | Comme [[informatique: | ||
+ | <code bash> | ||
+ | a=12; b=34; c=' | ||
+ | printf 'a=%i, b=%i, c=%s\n' | ||
+ | a=12, b=34, c=toto | ||
+ | </ | ||
+ | '' | ||
+ | |||
+ | Pour formater l' | ||
+ | <code bash> | ||
+ | a=12; b=34; c=' | ||
+ | # on aligne $a et $b à droite sur 5 colonnes, et $c à gauche sur 20 colonnes | ||
+ | printf ' | ||
+ | a= 12, b= 34, c=toto | ||
+ | </ | ||
+ | |||
+ | ====Afficher x fois le même caractère==== | ||
+ | |||
+ | Pour afficher 10 fois le caractère " | ||
+ | <code bash> | ||
+ | printf ' | ||
+ | ========== | ||
+ | </ | ||
=====ps===== | =====ps===== | ||
Line 2803: | Line 2828: | ||
=====type===== | =====type===== | ||
- | **type** est une commande interne de bash qui permet de savoir à quoi correspond un " | + | **type** est une commande interne de bash qui permet de savoir à quoi correspond un " |
<code bash> | <code bash> | ||
type -t ls | type -t ls | ||
| | ||
+ | |||
type -t l | type -t l | ||
alias | alias | ||
+ | |||
type l | type l | ||
l is aliased to 'ls -p --color' | l is aliased to 'ls -p --color' |
informatique/linux/commandes_linux.txt · Last modified: 2024/04/05 06:58 by pteu