Difference between revisions of "File (command)"

From Linuxintro
imported>ThorstenStaerk
(New page: file is a command to find out the type of a given file. Because for Linux, "everything is a file", it can distinguish a lot: # file /dev/sda1 /dev/sda1: block special (8/1) # file /tmp ...)
 
imported>ThorstenStaerk
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
file is a command to find out the type of a given file. Because for Linux, "everything is a file", it can distinguish a lot:
 
file is a command to find out the type of a given file. Because for Linux, "everything is a file", it can distinguish a lot:
 +
* hard disks
 
  # file /dev/sda1
 
  # file /dev/sda1
 
  /dev/sda1: block special (8/1)
 
  /dev/sda1: block special (8/1)
 +
* file systems
 +
# file -s ''/dev/sdc''
 +
''/dev/sdc'': Linux rev 1.0 ext3 filesystem data (needs journal recovery) (large files)
 +
* directories
 
  # file /tmp
 
  # file /tmp
 
  /tmp: sticky directory
 
  /tmp: sticky directory
 +
* links
 
  # file /lib64/libkeyutils.so.1
 
  # file /lib64/libkeyutils.so.1
 
  /lib64/libkeyutils.so.1: symbolic link to `libkeyutils-1.2.so'
 
  /lib64/libkeyutils.so.1: symbolic link to `libkeyutils-1.2.so'
 +
* normal files
 
  # file /lib64/libkeyutils-1.2.so
 
  # file /lib64/libkeyutils-1.2.so
 
  /lib64/libkeyutils-1.2.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), stripped
 
  /lib64/libkeyutils-1.2.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), stripped
 +
 +
= See also =
 +
* [[which]]
 +
* [[type]]
 +
* [[stat]]

Latest revision as of 18:46, 15 January 2012

file is a command to find out the type of a given file. Because for Linux, "everything is a file", it can distinguish a lot:

  • hard disks
# file /dev/sda1
/dev/sda1: block special (8/1)
  • file systems
# file -s /dev/sdc
/dev/sdc: Linux rev 1.0 ext3 filesystem data (needs journal recovery) (large files)
  • directories
# file /tmp
/tmp: sticky directory
  • links
# file /lib64/libkeyutils.so.1
/lib64/libkeyutils.so.1: symbolic link to `libkeyutils-1.2.so'
  • normal files
# file /lib64/libkeyutils-1.2.so
/lib64/libkeyutils-1.2.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), stripped

See also