Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

List Directories only 1

Status
Not open for further replies.

darfader

Programmer
Aug 6, 2003
38
GB
env SunOS 5.6
ksh


Hi,

I used to use this

ls -l | grep ^d

to list directories but am now receiving this error

$ ls -l | grep ^d
d: not found
$ Usage: grep -hblcnsviw pattern file . . .


what is another way to list only directories ?


tia,
 
Beware than mrregan solution will find all directories AND subdirectories, thus is not equivalent to jad solution.

You could also try:
Code:
ls -ld */.
which is faster to type (for command line usage) and faster to run (for script usage).

"When all else has failed, read the manuals."

Denis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top