Home » Infrastructure » Unix » listing only directories
listing only directories [message #168958] Mon, 24 April 2006 06:33 Go to next message
kmsalih
Messages: 197
Registered: March 2006
Senior Member
hi

i am new to unix shell programming.

i want to list only directories.

THe way is that cut the first character from the result of ls -l

ls -l | cut -c1


If that is d the display.

Is it possible to display it using a single line command.



Thanks in Advance
SALIH KM
Re: listing only directories [message #168987 is a reply to message #168958] Mon, 24 April 2006 08:53 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
ls -l | grep "^d"
Re: listing only directories [message #169112 is a reply to message #168987] Tue, 25 April 2006 02:47 Go to previous message
kmsalih
Messages: 197
Registered: March 2006
Senior Member
Thanks for the immediate response. Smile

[Updated on: Tue, 25 April 2006 02:49]

Report message to a moderator

Previous Topic: Can I make a script to check peripheral serials against a DB?
Next Topic: Starting sqlplus inside a shell script
Goto Forum:
  


Current Time: Fri Sep 22 02:46:11 CDT 2023