Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: ls -l *(/)...
- X-seq: zsh-users 20264
- From: lists@xxxxxxxxx
- To: Meino.Cramer@xxxxxx
- Subject: Re: ls -l *(/)...
- Date: Mon, 22 Jun 2015 19:59:24 +0200
- Cc: zsh-users@xxxxxxx
- In-reply-to: <20150622163654.GB4560@solfire>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20150622031753.GA4342@solfire> <55879C40.9020102@necoro.eu> <20150622163654.GB4560@solfire>
> ...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,
René
Messages sorted by:
Reverse Date,
Date,
Thread,
Author