Detailed listing of a directory/file with ls -l

ls is used to see the contents of a file. With the option -l, one can see the file/directory permissions for owner,group and others. This option is also useful to see information like the owner and group owner and size of the file.

let’s take a simple example. Seeing the detailed listing of a /usr/local/share/man/man1


$ ls -l /usr/share/man/man1/* | head -20

-rw-r--r-- 1 root root   1010 2008-08-20 19:05 2vcard.1.gz
-rw-r--r-- 1 root root    592 2010-06-25 18:20 411toppm.1.gz
-rw-r--r-- 1 root root    292 2010-07-21 21:45 a2j_control.1.gz
-rw-r--r-- 1 root root    413 2010-07-21 21:45 a2jmidi_bridge.1.gz
-rw-r--r-- 1 root root    424 2010-07-21 21:45 a2jmidid.1.gz
-rw-r--r-- 1 root root   4656 2010-07-12 17:11 a2p.1.gz
-rw-r--r-- 1 root root   5976 2010-08-16 16:25 a2ping.1.gz
-rw-r--r-- 1 root root   1356 2009-04-29 02:17 a2psj.1.gz
-rw-r--r-- 1 root root    798 2010-03-05 07:47 aalib-config.1.gz
-rw-r--r-- 1 root root   2608 2010-11-19 02:50 ab.1.gz
-rw-r--r-- 1 root root   1024 2010-07-02 16:05 ac3dec.1.gz
-rw-r--r-- 1 root root     20 2009-11-07 04:28 ace.1p.gz
-rw-r--r-- 1 root root  11985 2010-01-04 20:33 ack-grep.1p.gz
-rw-r--r-- 1 root root   1136 2010-02-02 06:29 aclocal-1.11.1.gz
-rw-r--r-- 1 root root   1068 2010-06-20 08:14 acl.php.1.gz
-rw-r--r-- 1 root root   1380 2010-10-22 03:46 aconnect.1.gz
-rw-r--r-- 1 root root    738 2005-10-25 15:32 aconnectgui.1.gz
-rw-r--r-- 1 root root    697 2009-12-25 13:56 acpi_available.1.gz
-rw-r--r-- 1 root root    367 2010-06-23 08:06 acpi_fakekey.1.gz
-rw-r--r-- 1 root root    823 2010-05-15 17:39 acyclic.1.gz

Since the above directory is a big directory, we used head to filter out first 20 lines. This example is going to be used in various tutorials like Vim Visual Block.

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