From unknown Sat Sep 13 21:03:17 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#25261 <25261@debbugs.gnu.org> To: bug#25261 <25261@debbugs.gnu.org> Subject: Status: ls -L: also allow seeing intermediate links Reply-To: bug#25261 <25261@debbugs.gnu.org> Date: Sun, 14 Sep 2025 04:03:17 +0000 retitle 25261 ls -L: also allow seeing intermediate links reassign 25261 coreutils submitter 25261 =E7=A9=8D=E4=B8=B9=E5=B0=BC Dan Jacobson severity 25261 normal tag 25261 notabug thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 24 10:12:48 2016 Received: (at submit) by debbugs.gnu.org; 24 Dec 2016 15:12:49 +0000 Received: from localhost ([127.0.0.1]:53853 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cKo08-0006Oj-MJ for submit@debbugs.gnu.org; Sat, 24 Dec 2016 10:12:48 -0500 Received: from eggs.gnu.org ([208.118.235.92]:52975) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cKo07-0006OQ-4l for submit@debbugs.gnu.org; Sat, 24 Dec 2016 10:12:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cKo01-0001Fz-6b for submit@debbugs.gnu.org; Sat, 24 Dec 2016 10:12:41 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.6 required=5.0 tests=BAYES_20,DATE_IN_PAST_03_06, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:51819) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cKo01-0001Fm-3C for submit@debbugs.gnu.org; Sat, 24 Dec 2016 10:12:41 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43929) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cKnzy-00061A-7k for bug-coreutils@gnu.org; Sat, 24 Dec 2016 10:12:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cKnzv-0001E8-9p for bug-coreutils@gnu.org; Sat, 24 Dec 2016 10:12:38 -0500 Received: from homie.mail.dreamhost.com ([208.97.132.208]:36724 helo=homiemail-a14.g.dreamhost.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cKnzv-0001Dg-3o for bug-coreutils@gnu.org; Sat, 24 Dec 2016 10:12:35 -0500 Received: from homiemail-a14.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a14.g.dreamhost.com (Postfix) with ESMTP id 2DC97392078 for ; Sat, 24 Dec 2016 07:12:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=jidanni.org; h=from:to :subject:date:message-id:mime-version:content-type; s= jidanni.org; bh=OUILDFKc5izqo9TZjR6uMsSnABE=; b=gLZt6QXEY8B5Xntw 00X5ihy00fWBCQ+EIJC4FyMfY7wbozeXU6wErPedKBJwyxZrAIy/fd3dUDATaPd0 J2pJFkCL+bN4xizY9tB/xR56lyBqO1lk9moDanJqg2hEKxdCXIZYysGffIU0yHXR r2J3ZmJ46D5GA2/S7IdaM/xFdn0= Received: from jidanni.org (114-41-24-177.dynamic.hinet.net [114.41.24.177]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: jidanni@jidanni.org) by homiemail-a14.g.dreamhost.com (Postfix) with ESMTPSA id E670B392075 for ; Sat, 24 Dec 2016 07:12:33 -0800 (PST) From: =?utf-8?B?56mN5Li55bC8?= Dan Jacobson To: bug-coreutils@gnu.org Subject: ls -L: also allow seeing intermediate links Date: Sat, 24 Dec 2016 20:10:21 +0800 Message-ID: <8737hdzfwy.fsf@jidanni.org> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -3.9 (---) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.9 (---) $ man ls -L, --dereference when showing file information for a symbolic link, show informa- tion for the file the link references rather than for the link itself Ah ah ah... so one can only see the first (no -L) or last (-L) of a e.g., long chain of symbolic links. Perhaps add a --symbolic-link-depth option to be able to see where an arbitrary depth of symbolic links points to. Or add a -L1, -L6, -L14 ... option. From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 27 16:21:30 2016 Received: (at control) by debbugs.gnu.org; 27 Dec 2016 21:21:30 +0000 Received: from localhost ([127.0.0.1]:57310 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cLzBa-0002Un-09 for submit@debbugs.gnu.org; Tue, 27 Dec 2016 16:21:30 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44258) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cLzBX-0002UT-U1; Tue, 27 Dec 2016 16:21:28 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1295F8553D; Tue, 27 Dec 2016 21:21:22 +0000 (UTC) Received: from [10.10.117.58] (ovpn-117-58.rdu2.redhat.com [10.10.117.58]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uBRLLJxr004498; Tue, 27 Dec 2016 16:21:20 -0500 Subject: Re: bug#25261: ls -L: also allow seeing intermediate links To: =?UTF-8?B?56mN5Li55bC8IERhbiBKYWNvYnNvbg==?= , 25261-done@debbugs.gnu.org, GNU bug control References: <8737hdzfwy.fsf@jidanni.org> From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg Organization: Red Hat, Inc. Message-ID: Date: Tue, 27 Dec 2016 15:21:19 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <8737hdzfwy.fsf@jidanni.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="QljmfPb62TWOWGAtcghJx4woNFwPUOspl" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 27 Dec 2016 21:21:22 +0000 (UTC) X-Spam-Score: -8.1 (--------) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -8.1 (--------) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --QljmfPb62TWOWGAtcghJx4woNFwPUOspl Content-Type: multipart/mixed; boundary="jr8QvGJbd5AuGvr3LNGGx2fn0Ri8msicC"; protected-headers="v1" From: Eric Blake To: =?UTF-8?B?56mN5Li55bC8IERhbiBKYWNvYnNvbg==?= , 25261-done@debbugs.gnu.org, GNU bug control Message-ID: Subject: Re: bug#25261: ls -L: also allow seeing intermediate links References: <8737hdzfwy.fsf@jidanni.org> In-Reply-To: <8737hdzfwy.fsf@jidanni.org> --jr8QvGJbd5AuGvr3LNGGx2fn0Ri8msicC Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable tag 25261 notabug thanks On 12/24/2016 06:10 AM, =E7=A9=8D=E4=B8=B9=E5=B0=BC Dan Jacobson wrote: > $ man ls > -L, --dereference > when showing file information for a symbolic link, show i= nforma- > tion for the file the link references rather than for t= he link > itself >=20 > Ah ah ah... so one can only see the first (no -L) or last (-L) of a > e.g., long chain of symbolic links. Correct, because that's all the kernel gives you, via lstat() (no -L) or stat() (-L). Since the kernel has no atomic way to stop halfway through a chain of symlink resolution (other than the fact that it stops with ELOOP if the chain would resolve but not in the amount of finite resources the kernel is willing to allot to the resolution), the best you could do is non-atomic approximations by a series of readlink() kernel calls, if you don't mind being subject to a TOCTTOU race condition= =2E > Perhaps add a --symbolic-link-depth > option to be able to see where an arbitrary depth of symbolic links > points to. You can already use the readlink and/or realpath utilities to follow a chain of symlinks one link at a time. And ls is already bloated enough that the bar is REALLY high for adding any new options, especially if the option is not already existing practice in some other implementation, or if the action could be performed via other existing command line tools. > Or add a -L1, -L6, -L14 ... option. Not possible. There is no way using getopt_long() to differentiate plain '-L' to mean something different than '-L1' - it gets parsed the same as '-L -1'. And we are not going to turn -L from no argument into an optional argument, as that would break existing users. Because what you seem to want is already available through readlink, I'm closing this as not a bug. But feel free to add further arguments, or propose a patch rather than just idle musings if you think there is more that we're overlooking. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --jr8QvGJbd5AuGvr3LNGGx2fn0Ri8msicC-- --QljmfPb62TWOWGAtcghJx4woNFwPUOspl Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJYYttPAAoJEKeha0olJ0Nqq1oIAKiXVw/y1nW5dHeZ5UP2CrwZ DdwzXi030lbZRgBi+kcqAYa/90GeMX+MpZT5kx1UVrTaF8w9HwRdjvy9cM3KrbyN Rex2cGkJ7oH8ro3lCVPNQHdmQrTSu7XVXz/pmJxntR0w/Aia52+HiaiXsxdNjSjE M8PFO7PSMMkb2AnaUHMZSyUkkbq9goIfT5GgOKXLJeLQWKz7HaTExJHZqidZf0uP Swodkgmlz+pQ9O982X2VIAYZrwZ6brJtWZR5Y22YOBnSZK8/lxKxVu9VlVwa7SW9 yVbiXBrwTPQfCt12aU/313d7SXycBnjToohKQJKmw8WAK7UoY1fKs2qcKDgbOs0= =cFlD -----END PGP SIGNATURE----- --QljmfPb62TWOWGAtcghJx4woNFwPUOspl-- From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 27 20:04:22 2016 Received: (at 25261-done) by debbugs.gnu.org; 28 Dec 2016 01:04:22 +0000 Received: from localhost ([127.0.0.1]:57431 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cM2fG-0002vh-8y for submit@debbugs.gnu.org; Tue, 27 Dec 2016 20:04:22 -0500 Received: from homie.mail.dreamhost.com ([208.97.132.208]:45574 helo=homiemail-a99.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cM2fE-0002vZ-Id for 25261-done@debbugs.gnu.org; Tue, 27 Dec 2016 20:04:20 -0500 Received: from homiemail-a99.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a99.g.dreamhost.com (Postfix) with ESMTP id C26B8D3E067; Tue, 27 Dec 2016 17:04:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=jidanni.org; h=from:to:cc :subject:references:date:message-id:mime-version:content-type: content-transfer-encoding; s=jidanni.org; bh=kDGiOE9PLWGYgx7oJbF zs3Wn3yw=; b=Q2rricsXhBOfdTLHo0GEE/vn0ClD8AfJIQ19BU327zaxh6FJzJu WM+VfeWlFLAafXzDYo/q3Lm/1H96Cu+Dp4naFPk/mjntQC6rDS9uekgrjgk3NGhd Mjs9/x2tCAe8c9PjrTHmthJbpO8Psuve179jiNyl0i5bRJXjbTlR3wgs= Received: from jidanni.org (122-118-145-8.dynamic.hinet.net [122.118.145.8]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: jidanni@jidanni.org) by homiemail-a99.g.dreamhost.com (Postfix) with ESMTPSA id 76A88D3E066; Tue, 27 Dec 2016 17:04:19 -0800 (PST) From: =?utf-8?B?56mN5Li55bC8?= Dan Jacobson To: Eric Blake Subject: Re: bug#25261: ls -L: also allow seeing intermediate links References: <8737hdzfwy.fsf@jidanni.org> Date: Wed, 28 Dec 2016 09:04:16 +0800 Message-ID: <87vau4hnjj.fsf@jidanni.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 25261-done Cc: 25261-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) OK. Perhaps on (info "(coreutils) Which files are listed") At =E2=80=98-L=E2=80=99 =E2=80=98--dereference=E2=80=99 When showing file information for a symbolic link, show information for the file the link references rather than the link itself. However, even with this option, =E2=80=98ls=E2=80=99 still prints th= e name of the link itself, not the name of the file that the link points to. perhaps mention that one in fact might see to the end of a long chain... and to see intermediate steps See Also: readlink. From unknown Sat Sep 13 21:03:17 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 25 Jan 2017 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator