Monday, October 23, 2006

Command of the week: ! ls

Yes, this week's command is (gasp!) ls. This seemingly simple Unix command actually is very useful and efficient (especially compared to its DOS counterpart, dir). Ls simply shows the contents of a present directory (list to ls), but with options it can be very adjustable and "pliant." For example, ls -l lists files in the directory and their accessibiltiy conditions, like this:

drwx------ 2 users 4096 Nov 2 19:51 mail/
drwxr-s--- 35 www 32768 Jan 20 22:39 public_html/
-rw------- 1 users 3 Nov 25 02:58 test.txt

(example from

Or, for another example, ls -a will show all hidden system files, like this:

$ (or % or >) ls -a
.cshrc .history .bash HelloWorld.c a.out


$ ls HelloWorld.c a.out

There are many other ls options. For more info. about them, do man ls at your shell prompt or go to these other sites:

Linux and UNIX ls command help / Concise chart of ls options /
Ls - Wikipedia, the free encyclopedia / Wiki article about ls /
Unix ls command / Technical details about ls and explanation of its useage /
Unix man pages : ls () / the technical man explanation of ls /

No comments: