Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: ls -l *(/)...

> ...unfortunately the command does not output eactly what I want...
> ls */*
> gives 
> directory:
> file1
> file2
> file3
> and I want
> directory/file1
> directory/file2
> directory/file3
> ...sorry I didn't mentioned that...
> Any way to acchieve this?

Well, here, the output is exactly like how you want it (do you have `ls`
being some alias?).

BUT: As you require your `ls`-Output to be exactly adhering to some
format, I'd argue that `ls` is not what you want in the first place.
Best guess is, all you need is the '*/*' itself which just represents
the list of files as you want them:
echo */*

Of course you can also iterate over them:
for f in */*; echo $(basename $f)

Also: Instead of using `ls` to get lists of files when globbing itself
does not work (or gets too complicated), I'd recommend using `find`.
Besides having lots of ways to express queries for files, it also allows
very easily to pass the results on farther down the pipe.

Best regards,

Messages sorted by: Reverse Date, Date, Thread, Author