From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22494 invoked by alias); 18 Aug 2013 05:06:33 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 17939 Received: (qmail 22349 invoked from network); 18 Aug 2013 05:06:27 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <130817220559.ZM3201@torch.brasslantern.com> Date: Sat, 17 Aug 2013 22:05:59 -0700 In-reply-to: <20130818024002.GC3129@solfire> Comments: In reply to meino.cramer@gmx.de "Dereferencing a symlink...or that alike..." (Aug 18, 4:40am) References: <20130818024002.GC3129@solfire> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: Dereferencing a symlink...or that alike... MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Aug 18, 4:40am, 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? Depends on what is covered by "or such" ... % zmodload zsh/stat % zstat +link etcetera /etc However, that prints nothing if the file is not a symbolic link. I don't know of any external utility that will print *only* the target of the symlink. E.g. % /usr/bin/stat --format=%N etcetera 'etcetera' -> '/etc'