The Haiku/BeOS Tip Server
Tips and tricks for Haiku/BeOS users

Grokking file details

Contributed by: Scot Hacker
This tip is valid for: Both BeOS and Haiku

When in Terminal, typing ls will get you a list of the files in that directory. Doesn’t tell you a whole lot, though. If you want to learn more about your files, type: ls -l to get a “long” listing. This will bring up something like:

-rwxr-xr-x 1 baron users 3488 Jan 21 21:30

Some of this is obvious, some of it isn’t. The first letter tells you whether it’s a directory or a file. If it’s a directory, the “-” will be replaced by a “d.” The rest of the block represents the file’s permission settings. Nine characters, which are actually three groups of three letters each. The first three are Read, Write, and Execute permission settings for the owner (which is always you, until Be implements a full multi-user system). The second three are for the group, and the final three for the rest of the world.

“1” represents the number of hard links to the file. So, in:


-rw-r--r-- 2 arthurvl infstud 44 Feb 26 15:06 linkdemo
-rw-r--r-- 2 arthurvl infstud 44 Feb 26 15:06 linkdemo2

The files linkdemo and linkdemo2 are actually one file with two entries in the directory. The next group is the size of the file in bytes, then, obviously, the time and date stamps.

Typing ls -a will show you All files, including hidden system files. ls -l -a, or even ls -la will show you all files, including hidden files, in long format.

Thanks to Arthur van Leeuwen for details on hard links in this tip.

Posted in Tracker & Deskbar


(comments are closed).