zsh-users
 help / color / mirror / code / Atom feed
From: Phil Pennock <zsh-workers+phil.pennock@spodhuis.org>
To: meino.cramer@gmx.de
Cc: zsh-users@zsh.org
Subject: Re: Dereferencing a symlink...or that alike...
Date: Sun, 18 Aug 2013 00:30:01 -0400	[thread overview]
Message-ID: <20130818043001.GA4295@redoubt.spodhuis.org> (raw)
In-Reply-To: <20130818024002.GC3129@solfire>

On 2013-08-18 at 04:40 +0200, meino.cramer@gmx.de wrote:
> suppose I have the following symlink in my $HOME
> 
>     etcetera -> /etc
> 
> . Is there a way to get back "/etc" only (not the contents
> of /etc/. nor "etcetera") when doing a 'ls' or such?

The not-specific-to-zsh bit:

  $ ls -Lld etcetera

The -L says to chase the symlink when given on the command-line.  You
then want -d to not list the contents of the directory, only the
directory itself.

The options require vary by command used.

For the zsh "zstat" module-provided builtin, "zstat -L" will give you a
"link" field.

  % zstat -L +link etcetera 
  /etc

-Phil


  reply	other threads:[~2013-08-18  4:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-18  2:40 meino.cramer
2013-08-18  4:30 ` Phil Pennock [this message]
2013-08-18  5:05 ` Bart Schaefer
2013-08-19  4:13   ` Phil Pennock

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=20130818043001.GA4295@redoubt.spodhuis.org \
    --to=zsh-workers+phil.pennock@spodhuis.org \
    --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).