Re: ls lacking a feature?



Richard Heathfield wrote:
Bernard Liang said:

Well,

...you just want the directory name, not all the gubbins, so you thought
you'd try:

ls -l | grep ^d | tr -s ' ' | cut -d' ' -f9

This is slightly shorter:

ls -al | grep ^d | awk '{ print $9 }'

In my version of ls -l the file name is the eighth field and those don't work
very well if the names have spaces in them.


John
--
use Perl;
program
fulfillment
.