[PLUG] listing directories only with ls- solved

David Fleck david.fleck at mchsi.com
Thu Dec 7 02:51:17 UTC 2006


On Wed, 6 Dec 2006, Piet van Weel wrote:

> So except for the prettiness what is the difference of doing:
> 
> ls -d */
> 
> And 
> 
> ls * | grep /


The only use I've *ever* found for the -d option is as a modifier to 'ls 
-l', when I want to see the permissions/ownership of a directory, but not 
the full listing of everything in the directory.  (Which you could also do 
by 'ls -l' on the parent directory and piping to grep, but it saves a few 
keystrokes.)

E.g., 
 dcf>$ ls -dl sourweb/
 drwxr-xr-x  3 dcf users 4096 Dec 31  2005 sourweb/

 dcf>$ ls -l sourweb/
 total 656K
 -rw-r--r--   1 dcf users   4027 May  7  2000 3.27.txt
 -rw-r--r--   1 dcf users   4602 May  7  2000 5.8.txt
 ...
 ...
 .etc
 ...

--
David Fleck
david.fleck at mchsi.com




More information about the PLUG mailing list