[wplug] ls puzzle

Brandon Kuczenski brandon at 301south.net
Mon Oct 4 00:27:42 EDT 2004


> On Sun, Oct 03, 2004 at 06:04:26PM -0400, Brandon Kuczenski wrote:
> > the challenge: how to list all files in a directory, but omit
> > subdirectories?  I've come up with the following, but would like something
> > more efficient:
> >
> > ls -l | grep -v ^d | awk ' { print $NF } '
>
> find -type f -maxdepth 1
>

Thanks -- that's right.. now, I just discovered that I guess I don't use
'-' correctly.  The directory where I ran that command now has a file
named '-' but I thought that a 'filename' called '-' was just a secret
code telling bash to use a little magical temporary file of some kind.
Was I mistaken?  I guess the only place I've seen '-' used is with tar -f,
usually in conjunction with ssh.\

Seeking clarity..
-Brandon



More information about the wplug mailing list