How to Differentiate Between Files and Folders?

Hi All,

I'm a rookie using HPUX and I know this is going to sound like a bonehead question, but when I list the contents of a directory, how can I determine which objects are files and which are folders? I'm using the ll and ls commands to lists the contents. So far I've been determining the object types by trying to cd/more the objects and see what happens. I figured there's gotta be a better way.

Thanks in advance.

I think I just figured it out. Anything that's a directory seems to be 96 bytes. Does this sound like a reliable method?

Thanks,

Dan

drwxr-x---

If it startes with "dr"

Thanks if you were thinking about responding.

Half right :slight_smile: , if it starts with a 'd' it's a directory (the r is the start of the permissions and shows that the file owner can read the file - use "man ls" for lots of info on all of the fields displayed by ls)

cheers

It is completely legitimate question BTW.

In the head of output by ls -l

  • stands for a regular file
    d stands for directory
    l stands for a symbolic link
    c stands for character oriented device
    b stands for block oriented device

You can figure out more by using "man ls" command.
Get "UNIX Essentials and UNIX Core" DVD course or "UNIX in 24 hours" book as them address questions of this sort.
Hope it helps.

Thanks for all the replies. I'll look into those resources.

Here another visual way to represent folders and other objects, such as links. Us e the -F option of ls.