Link to home
Start Free TrialLog in
Avatar of m_razesh
m_razesh

asked on

FILE COMMAND

Hi
I am new to UNIX.
I want to clarify one thing--
an eg is given as-- $ file monday reports
and the book states monday : text file
                             reports : directory.. How can we know tht its a text file?and directory?
and same as another  $ file calc.c proj newdata
here calc.c is C prog and proj - executable file and newdata is empty file.

So how to classify them ..On what basis are they classified?..
Avatar of ahoffmann
ahoffmann
Flag of Germany image

the file command relies on the /etc/magic file which contains patterns to identify a files content

> How can we know tht its a text file?and directory?
not with the file command, obviously (see its name:-)
use ls -l

> here calc.c is C prog and proj - executable file and newdata is empty file.
what do you mean?
If a file is executable (see ls -l) or not doesn't matter the file command.
Avatar of Tintin
Tintin

man magic
ASKER CERTIFIED SOLUTION
Avatar of shmukler
shmukler
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial