Issue:
How can I get more information about files and executables?
Resolution:
The
stat command allows users to quickly view standard
metadata about files on their system. This is useful in debugging or obtaining file-aging information. The command is also useful for finding out when a file was last modified or accessed.
stat outputs all of the information it can display about a single file, even if the user does not have permissions to read the file. The user must, however, have at least list permission on the directory in which the file lives (denoted by "x" in the output of
ls -l).
To use
stat, use the file name as an argument. For example, run
stat picture.jpg, the output would look like this:
Quote:
$ stat picture.jpg
File: "picture.jpg"
Size: 148176 Blocks: 304 IO Block: 4096 Regular File
Device: 821h/2081d Inode: 231 Links: 1
Access: (0600/-rw-------) Uid: ( 1000/ qc) Gid: ( 1000/ qc)
Access: Mon Feb 12 22:55:21 2004
Modify: Mon Feb 12 22:19:57 2004
Change: Mon Feb 12 22:19:57 2004
|
Another useful tool is
file. The
file command identifies the type of file whose name is provided as an argument. It can identify well-known types of files and provide information about the data stored in them.
For example, running the command
file picture.jpg might return output like:
Quote:
$ file picture.jpg
picture.jpg: JPEG image data,
JFIF standard 1.02, resolution (DPI),
72 x 72
|
The
file command can also return information about an executable:
Quote:
$ file netwatch
netwatch: ELF 32-bit LSB executable,
Intel 80386, version 1 (SYSV),
dynamically linked (uses shared libs),
not stripped
|
You can also run
file * to get information for all of the files in your local directory. That output might look like this:
Quote:
$ file *
Mail: directory
column: English text
export: directory
foo.pl: perl script text
inv2: ASCII text
legend1.gif: GIF image data, version 87a, 573 x 391
mail: symbolic link to Mail/
master.zip: Zip archive data, at least v2.0 to extract
postponed: empty
|
------------------------
Best Regards,
eUKShane :P
http://www.eukhost.com