Discussion: listing directories
Afficher un message
Vieux 20/08/2006, 01h53   #10
bsh
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: listing directories

Steve Youngs wrote:
> ls -d */ # just ordinary directories
> ls -d .*/ # just dot-directories
> ls -d .*/ */ # both
> Add `1' (one) to the options (ls -d1) if you need a single column.


If one only wants single-column output, then do
not fork an entire process just to do it:

print -r -- .*/. */.

P.S.:

RTFM for shell option modifiers that can affect
the above behavior:

set -m & set -o markdirs
set -n & set -o noglob

BUG: Unfortunately, in ksh(1), the converse does
NOT emit only non-directory files:

print -r -- !(*/.) # doesn't work!

=Brian

  Réponse avec citation
 
Page generated in 0,05616 seconds with 9 queries