Reading a Directory Listing
Consider the following output of an [ls –al] command executed at the root.
drwxr-xr-x 2 root root 4096 Feb 10 16:12 bin
drwxr-xr-x 4 root root 1024 Feb 10 16:04 boot
drwxr-xr-x 17 root root 77824 Mar 31 05:57 dev
drwxr-xr-x 69 root root 8192 Mar 31 05:57 etc
-rwxr-xr-x 1 root root 0 Mar 30 13:28 ExecutableFile
drwxr-xr-x 3 root root 4096 Feb 10 16:13 home
drwxr-xr-x 2 root root 4096 Jun 21 2001 initrd
drwxr-xr-x 7 root root 4096 Feb 10 16:07 lib
drwxr-xr-x 2 root root 16384 Feb 10 15:03 lost+found
drwxr-xr-x 2 root root 4096 Aug 29 2001 misc
drwxr-xr-x 4 root root 4096 Feb 10 21:14 mnt
drwxr-xr-x 2 root root 4096 Aug 23 1999 opt
dr-xr-xr-x 45 root root 0 Mar 31 00:56 proc
-rw-r--r-- 1 root root 0 Mar 30 13:28 RegularFile
drwxr-x--- 4 root root 4096 Mar 6 13:44 root
drwxr-xr-x 2 root root 8192 Feb 10 16:09 sbin
drwxr-xr-x 3 root root 4096 Feb 10 16:08 tftpboot
drwxrwxrwt 3 root root 4096 Mar 31 06:02 tmp
drwxr-xr-x 16 root root 4096 Feb 10 15:57 usr
drwxr-xr-x 26 root root 4096 Feb 11 20:40 var
This directory listing is different than a standard DOS format directory listing and provides a great deal of information about the files shown. From left to right, the columns displayed are permissions, number of files linked to this file (shortcuts), user owner, group owner, file size (bytes), last modification date, and the file name.
In a future article, I will address permissions in greater detail. There are 10 characters in a permission string. The first character is used to denote the file type. For regular files, this character is left blank and displays ‘d’ for directories. Some other characters you will see in this position include ‘b’, ‘c’, ‘l’, and ‘s’. Files that represent hardware devices usually have a type of binary (b), meaning the file represents a binary stream.