zsh-users
 help / color / mirror / code / Atom feed
From: lists@necoro.eu
To: Meino.Cramer@gmx.de
Cc: zsh-users@zsh.org
Subject: Re: ls -l *(/)...
Date: Mon, 22 Jun 2015 19:59:24 +0200	[thread overview]
Message-ID: <55884CFC.6010803@necoro.eu> (raw)
In-Reply-To: <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é


  parent reply	other threads:[~2015-06-22 17:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-22  3:17 Meino.Cramer
2015-06-22  5:25 ` lists
     [not found]   ` <20150622163654.GB4560@solfire>
2015-06-22 17:59     ` lists [this message]
2015-06-22 18:30       ` Bart Schaefer
2015-06-22 21:28         ` Bernd Steinhauser
2015-06-22 19:08       ` Marc Chantreux
2015-06-22 19:26         ` lists
2015-06-22 20:31           ` Roman Neuhauser
2015-06-23 11:30           ` Marc Chantreux

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55884CFC.6010803@necoro.eu \
    --to=lists@necoro.eu \
    --cc=Meino.Cramer@gmx.de \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).