Posted by: jasonk2600 | November 18, 2009

Better Listing with LS

Tired of the plain, monochrome directory and file listings with the ls command?  Try adding a couple more options:

Adding the –la option will format the listing in a nice list with additional information such as owner, group, file size, and modification date:

# ls -la
total 42
drwxr-xr-x   6 root  wheel   512 Nov  9 19:08 .
drwxr-xr-x  19 root  wheel   512 Nov  4 17:15 ..
-rw-r--r--   2 root  wheel   798 Oct 25 01:04 .cshrc
-rw-------   1 root  wheel  2679 Nov 18 14:10 .history
-rw-r--r--   2 root  wheel   265 Oct 25 01:04 .profile
-rw-------   1 root  wheel  1024 Nov 14 15:27 .rnd
drwx------   2 root  wheel   512 Nov  3 20:29 .ssh
drwxr-xr-x   2 root  wheel   512 Nov  6 15:54 confbak
drwxr-xr-x   2 root  wheel   512 Nov  7 17:13 cvsup
drwxr-xr-x   2 root  wheel   512 Nov  3 20:39 kernels
-rw-r--r--   1 root  wheel  1328 Nov  4 17:10 rc.conf

Adding the –F option will add a trailing backslash to any directories:

# ls -laF
total 42
drwxr-xr-x   6 root  wheel   512 Nov  9 19:08 ./
drwxr-xr-x  19 root  wheel   512 Nov  4 17:15 ../
-rw-r--r--   2 root  wheel   798 Oct 25 01:04 .cshrc
-rw-------   1 root  wheel  2679 Nov 18 14:10 .history
-rw-r--r--   2 root  wheel   265 Oct 25 01:04 .profile
-rw-------   1 root  wheel  1024 Nov 14 15:27 .rnd
drwx------   2 root  wheel   512 Nov  3 20:29 .ssh/
drwxr-xr-x   2 root  wheel   512 Nov  6 15:54 confbak/
drwxr-xr-x   2 root  wheel   512 Nov  7 17:13 cvsup/
drwxr-xr-x   2 root  wheel   512 Nov  3 20:39 kernels/
-rw-r--r--   1 root  wheel  1328 Nov  4 17:10 rc.conf

Adding the -G option will add color to the listing:

# ls –laFG
total 42
drwxr-xr-x   6 root  wheel   512 Nov  9 19:08 ./
drwxr-xr-x  19 root  wheel   512 Nov  4 17:15 ../
-rw-r--r--   2 root  wheel   798 Oct 25 01:04 .cshrc
-rw-------   1 root  wheel  2679 Nov 18 14:10 .history
-rw-r--r--   2 root  wheel   265 Oct 25 01:04 .profile
-rw-------   1 root  wheel  1024 Nov 14 15:27 .rnd
drwx------   2 root  wheel   512 Nov  3 20:29 .ssh/
drwxr-xr-x   2 root  wheel   512 Nov  6 15:54 confbak/
drwxr-xr-x   2 root  wheel   512 Nov  7 17:13 cvsup/
drwxr-xr-x   2 root  wheel   512 Nov  3 20:39 kernels/
-rw-r--r--   1 root  wheel  1328 Nov  4 17:10 rc.conf

 

 [EoF]
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: