file etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster
file etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster

25 Kasım 2018 Pazar

file komutu

Giriş
Hiçbir seçenek ile kullanılmazsa dosya ismini bir kere daha yazar. Şöyle yaparız.
$ file some.pdf
some.pdf: PDF document, version 1.4
Resmin renk uzayını belirlemek için file komutu kullanılabilir. Örnek'te komutun RGB döndürüldüğü görülebilir.
$ file file.png
file.png: PNG image data, 734 x 73, 8-bit/color RGB, non-interlaced
Exit Status
Açıklaması şöyle
EXIT STATUS
     file will exit with 0 if the operation was successful or >0 if an error was encoun‐
     tered.  The following errors cause diagnostic messages, but don't affect the pro‐
     gram exit code (as POSIX requires), unless -E is specified:
           •   A file cannot be found
           •   There is no permission to read a file
           •   The file type cannot be determined
Örnek
Şöyle yaparız
$ file -E saonteuh; echo $?
saonteuh: ERROR: cannot stat `saonteuh' (No such file or directory)
1
-b seçeneği
brief anlamına gelir. Dosya ismini yazmaz. Şöyle yaparız.
$ file -b some.pdf
PDF document, version 1.4
-i seçeneği
mime ve encoding bilgisini verir. Açıklaması şöyle.
The file -bi command will output the MIME type of the file. For a shell script on Linux (and most other systems), this would be something like
text/x-shellscript; charset=us-ascii
Örnek
Şöyle yaparız.
$ file -bi some.pdf
application/pdf; charset=binary
-mime-type seçeneği
Sadece mime tipini verir. Şöyle yaparız.
$ file -b --mime-type some.pdf
application/pdf