Half of a ls -l ? [INFO-UNIX Digest V12#102]
Udo Walter, SYS ADM, CDOIM
asqe-x-w-ic03 at worms-emh1.army.mil
Thu May 16 00:00:18 AEST 1991
robby at nuchat.sccsi.com (Robert Oliver Jr.) writes:
> Has anybody out there ever printed out the size, date and name of a file
>without the permissions and owners just the size, date & name. I would like
>to know how you did it!
Try this one. It gives tells you also whether it's a file or a directory.
Put it in a scriptfile and make it executable.
ls -al $1 | nawk '{if (match($1,"d"))
printf("<DIR> %7d %3s %2s %5s %s\n",$5,$6,$7,$8,$9)
else
printf(" %7d %3s %2s %5s %s\n",$5,$6,$7,$8,$9)}'| more
Udo Walter
More information about the Comp.unix.questions
mailing list