File

De bricosoft
Aller à la navigation Aller à la recherche

file est une commande unix pour obtenir des infos sur un fichier.

Exemple :

$ file Bureau/dr.txt
Bureau/dr.txt: ASCII text

Infos sur les périphériques

file -s /dev/sd*
$ sudo file -s /dev/sd*
/dev/sda:  x86 boot sector; partition 1: ID=0x83, starthead 1, startsector 63, 401562 sectors; partition 2: ID=0x83, starthead 0, startsector 401625, 310054500 sectors; partition 3: ID=0x82, starthead 254, startsector 310456125, 2088450 sectors, code offset 0x63
/dev/sda1: Linux rev 1.0 ext4 filesystem data, UUID=dda5a363-08e0-4b8a-b5d7-4e9661ae5b4f (needs journal recovery) (extents) (huge files)
/dev/sda2: Linux rev 1.0 ext4 filesystem data, UUID=6ae186da-8f32-4e00-be35-8f036048381a (needs journal recovery) (extents) (large files) (huge files)
/dev/sda3: Linux/i386 swap file (new style), version 1 (4K pages), size 261055 pages, no label, UUID=410858d7-5cb1-4467-bb02-90ed63edc3c4

Afficher vos partitions

$ sudo file -bs /dev/sda | sed -e 's/.*partition 1\(.*\) code offset.*/partition 1\1/g' -e 's/\(.\);/\1\n/g'
partition 1: ID=0x83, starthead 1, startsector 63, 401562 sectors
partition 2: ID=0x83, starthead 0, startsector 401625, 310054500 sectors
partition 3: ID=0x82, starthead 254, startsector 310456125, 2088450 sectors

Liens

{{#switch:|subgroup|child=|none=|#default=

}}