Corrigé 10.3 cut

1.

[tux]$ cut -f1,3 -d: /etc/group 
root:0 
bin:1 
daemon:2 
sys:3 
adm:4 
... 

2.

[tux]$ ls -l /etc 
total 3348 
-rw-r--r--   1 root root   15289 mar 23 17:18 a2ps.cfg 
-rw-r--r--   1 root root    2562 mar 23 17:18 a2ps-site.cfg 
drwxr-xr-x   4 root root    4096 mai 22 12:29 acpi 
-rw-r--r--   1 root root      46 jun 23 03:42 adjtime 
drwxr-xr-x   4 root root    4096 mai 22 12:30 alchemist 
-rw-r--r--   1 root root    1512 avr 25 18:48 aliases 
-rw-r-----   1 root smmsp  12288 jun 29 00:02 aliases.db 
drwxr-xr-x   4 root root    4096 mai 22 12:31 alsa 
drwxr-xr-x   2 root root    4096 mai 22 12:43 alternatives  
... 
[tux]$ ls -l /etc | cut -c 2-10,26-31,45- 
otal 3348 
rw-r--r--  15288 a2ps.cfg 
rw-r--r--   2568 a2ps-site.cfg 
rwxr-xr-x   4099 acpi 
rw-r--r--     42 adjtime 
rwxr-xr-x   4090 alchemist 
rw-r--r--   1518 aliases 
rw-r-----  12282 aliases.db 
rwxr-xr-x   4091 alsa 
rwxr-xr-x   4093 alternatives 
... 

Note

Les numéros de colonnes indiqués à la commande cut dépendent de l’affichage retourné par la commande ls -l, lui-même dépendant des fichiers affichés et du type de terminal employé.

couv_TP4BLIN.png

Découvrez 

le livre :

Aussi inclus dans nos :

Précédent
Corrigé 10.2 grep
Suivant
Corrigé 10.4 sort