Oct 22, 2003 #1 darfader Programmer Joined Aug 6, 2003 Messages 38 Location 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,
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,
Oct 22, 2003 1 #2 mrregan MIS Joined Nov 2, 1999 Messages 490 Location US how about find . -type d -print Upvote 0 Downvote
Oct 22, 2003 #3 jad Programmer Joined Apr 7, 1999 Messages 1,195 Location GB you could try doing ^d in '' quotes. Upvote 0 Downvote
Oct 22, 2003 Thread starter #4 darfader Programmer Joined Aug 6, 2003 Messages 38 Location GB yes, they both work, thanks Upvote 0 Downvote
Oct 25, 2003 #5 dchoulette Programmer Joined Jun 25, 2002 Messages 245 Location FR 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 Upvote 0 Downvote
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