From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7987 invoked by alias); 18 Aug 2013 04:48:20 -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: 17938 Received: (qmail 10913 invoked from network); 18 Aug 2013 04:48:16 -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=-4.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at spodhuis.org does not designate permitted sender hosts) 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=; Date: Sun, 18 Aug 2013 00:30:01 -0400 From: Phil Pennock To: meino.cramer@gmx.de Cc: zsh-users@zsh.org Subject: Re: Dereferencing a symlink...or that alike... Message-ID: <20130818043001.GA4295@redoubt.spodhuis.org> Mail-Followup-To: meino.cramer@gmx.de, zsh-users@zsh.org References: <20130818024002.GC3129@solfire> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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