Bash - Commandes Shell
Alasta 9 Juillet 2016 bash bash shell cli
Description : Voici quelques commandes Shell.
Envoie message Syslog sur un serveur distant
nc -w0 -u 192.168.1.1 514 <<< "Test 12345 script envoie syslog UDP"
Commande ls
Options pour l’affichage de la date et l’heure
option : –time-style=[STYLE]
[STYLE]
- full-iso
- long-iso
- iso
- locale
- +%Y-%m-%d %H:%M:%S
$ ls -l --time-style=full-iso
total 28
-rw-r--r-- 1 root root 745 2015-08-19 03:09:29.000000000 +0000 back.ldif
-rw-r--r-- 1 root root 87 2016-07-24 13:18:45.511717070 +0000 delete_masse.txt
-rw-r--r-- 1 root root 578 2015-08-19 03:09:29.000000000 +0000 front.ldif
-rw-r--r-- 1 root root 627 2015-08-19 03:09:29.000000000 +0000 more.ldif
-rw-r--r-- 1 root root 672 2016-07-24 13:24:15.956947346 +0000 more2.ldof
-rw-r--r-- 1 root root 187 2015-08-19 03:09:29.000000000 +0000 sssvlv_config.ldif
-rw-r--r-- 1 root root 90 2015-08-19 03:09:29.000000000 +0000 sssvlv_load.ldif
$ ls -l --time-style=+"%Y-%m-%d %H:%M:%S"
total 28
-rw-r--r-- 1 root root 745 2015-08-19 03:09:29 back.ldif
-rw-r--r-- 1 root root 87 2016-07-24 13:18:45 delete_masse.txt
-rw-r--r-- 1 root root 578 2015-08-19 03:09:29 front.ldif
-rw-r--r-- 1 root root 627 2015-08-19 03:09:29 more.ldif
-rw-r--r-- 1 root root 672 2016-07-24 13:24:15 more2.ldof
-rw-r--r-- 1 root root 187 2015-08-19 03:09:29 sssvlv_config.ldif
-rw-r--r-- 1 root root 90 2015-08-19 03:09:29 sssvlv_load.ldif
Options sur l’affichage du contenu d’un dossier
option : –format=[format]
[format]
- across
- comma
- horizontal
- long
- single-column
- verbose
- vertical
$ ls -l --format=single-column
back.ldif
delete_masse.txt
front.ldif
more.ldif
more2.ldof
sssvlv_config.ldif
sssvlv_load.ldif
Options sur les fichiers :
option : –sort=[SORT]
[SORT]
- extension
- none
- size
- time
- version
$ ls -al --sort=extension
total 36
drwxr-xr-x 2 root root 4096 Jul 24 13:24 .
drwxr-xr-x 46 root root 4096 Jul 24 13:18 ..
-rw-r--r-- 1 root root 745 Aug 19 2015 back.ldif
-rw-r--r-- 1 root root 578 Aug 19 2015 front.ldif
-rw-r--r-- 1 root root 627 Aug 19 2015 more.ldif
-rw-r--r-- 1 root root 187 Aug 19 2015 sssvlv_config.ldif
-rw-r--r-- 1 root root 90 Aug 19 2015 sssvlv_load.ldif
-rw-r--r-- 1 root root 672 Jul 24 13:24 more2.ldof
-rw-r--r-- 1 root root 87 Jul 24 13:18 delete_masse.txt