[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ls and globbing and full pathnames



x_debian-user_x@nospam.pz.podzone.net wrote:
find /var/www/* -follow -maxdepth 1 -type f
this will not work, except you only have one non-dot entry in /var/www - the
first argument can only be one directory, where /var/www/* will be expanded
to list of all files/directories (except those beginning with a dot) in
/var/www.

Ummm, it works for me... ;-) Using GNU 'find' as supplied with Debian.

As it does, as well, on Solaris (the only other *nix OS available to me at the moment). From the Solaris man page, the synopsis says:

SYNOPSIS
     /usr/bin/find path... expression

     /usr/xpg4/bin/find path... expression

Note the ellipses (...) after the 'path' in each. As well, there are no restrictions as to whether path is a directory or a filename, either.

The primary issue with the form the original poster used (and it may not be an issue, either, but intentional) is that the wildcard path will automatically *exclude* any and all files/directories whose names begin with a dot, such as .kde or .tkman, for example.

Whether this is a problem or a feature depends on exactly what the OP is trying to do.

Bob


if you really want a comma seperated list, the check out sed or cut.
Maybe this would suffice (note it prints directories as well):

ls -dm /var/www/*/*
yes, this might work

Indeed it does too.


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


Reply to: