Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Dereferencing a symlink...or that alike...
- X-seq: zsh-users 17938
- From: Phil Pennock <zsh-workers+phil.pennock@xxxxxxxxxxxx>
- To: meino.cramer@xxxxxx
- Subject: Re: Dereferencing a symlink...or that alike...
- Date: Sun, 18 Aug 2013 00:30:01 -0400
- Cc: zsh-users@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=spodhuis.org; s=d201210; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=Gen94mKkNc+CITmJhJSxriSnf10LrXVjnBC+Kq3Cvi4=; b=LtV9kqft8X2WOZIeCdJD8HpPp5KGgGtjNBkoBqNsTk8qWDouSQV3z48p8EcoRPjZBtogT+4Vi6PuKDsFXH4WWqhdlMIdFmvLd1Nl6dIAZcM03s+TqERe0BvXN6nxqnVUKakBJlHVYbzaS5WBhFeyc7r6Fsjkh/wfIuRidsCa4oQ=;
- In-reply-to: <20130818024002.GC3129@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>
- Mail-followup-to: meino.cramer@xxxxxx, zsh-users@xxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20130818024002.GC3129@solfire>
On 2013-08-18 at 04:40 +0200, meino.cramer@xxxxxx 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author