Re: ls lacking a feature?
- From: Logan Shaw <lshaw-usenet@xxxxxxxxxxxxx>
- Date: Thu, 29 Jun 2006 02:48:09 GMT
Roger Willcocks wrote:
"Bernard Liang" <b_liang@xxxxxxxxxxxx> wrote in message news:e7usv4$29o5$1@xxxxxxxxxxxxxxxxxxxxxhow does one perform the equivalent MS-DOS's "dir /a:d" (directory listing) in *ix (say, linux)?
ls -lF | grep /
or
find -maxdepth 1 -type d -exec ls -ld {} \;
Here's the obligatory Perl solution:
perl -le 'print for grep { -d } <*>'
If you're going for shortness, this might be closer:
perl -le '-d && print for <*>'
Or if you want to go make a different compromise between keystroke
economy and readability:
perl '-le-d&&print for<*>'
I never, until just this moment, realized you could combine command
line switches and code in the same argv[] array element, but apparently
you can, and it makes sense in a weird kind of way.
But then again, this is Perl, so making sense in a weird kind of way
is par for the course.
- Logan
.
- References:
- ls lacking a feature?
- From: Bernard Liang
- Re: ls lacking a feature?
- From: Roger Willcocks
- ls lacking a feature?
- Prev by Date: Re: ls lacking a feature?
- Next by Date: Re: Any online source management for personal projects ?
- Previous by thread: Re: ls lacking a feature?
- Next by thread: Re: ls lacking a feature?
- Index(es):