Friday, May 21, 2010

What types of files exist in Unix and how they can be expressed using the first character (Unix)?

when you use the command "ls -l" u get:


-rw--x-- 1 name xfile





so the first character (i.e.: - ) means that this is a file, while the first character "d" means that its a directory.


what other types of files exist in unix and how are they expressed using the first character?





(Red Hat Linux)

What types of files exist in Unix and how they can be expressed using the first character (Unix)?
block special file b


character special file c


link l


pipe p
Reply:I think you are confused, if I am understanding you correctly.





-rw--x-- has nothing to do with the filename. That is the permissions of the file in relationship to the users, groups, and world.





Example:





ls -l


-rw-r--r-- 1 jb jd 100664 Mar 2 15:09 testfile





-rw-r--r-- = file permissions


jb = user that owns the file


jd = group that owns the file


100664 = filesize


Mar 2 15:09 = date last modified


testfile = filename





Typing "ls" at the prompt will give you filenames only, minus all of the above information. Hope this helps.


No comments:

Post a Comment