Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #219440 > unrolled thread

link question

Started byghe <ghe@slsware.net>
First post2020-02-25 21:30 +0100
Last post2020-02-26 17:20 +0100
Articles 4 — 4 participants

Back to article view | Back to linux.debian.user


Contents

  link question ghe <ghe@slsware.net> - 2020-02-25 21:30 +0100
    Re: link question Greg Wooledge <wooledg@eeg.ccf.org> - 2020-02-25 21:30 +0100
      Re: link question Charles Curley <charlescurley@charlescurley.com> - 2020-02-26 06:40 +0100
    Re: link question David Wright <deblis@lionunicorn.co.uk> - 2020-02-26 17:20 +0100

#219440 — link question

Fromghe <ghe@slsware.net>
Date2020-02-25 21:30 +0100
Subjectlink question
Message-ID<zDP05-5jU-1@gated-at.bofh.it>
What does, in /usr/bin/X11, 'X11 -> .' mean?

Looks to me like it means 'link <here> to <here>'

When I do 'ls /usr/bin/X11 | grep X11' I get X11.
When I do 'ls /usr/bin/X11/X11/X11 | grep X11' I get X11.

When I do 'du -sh /usr/bin/X11/' I get 81M.
When I do 'du -sh /usr/bin/X11/X11/X11/' I get 81M.

When I do 'ls X11 >X11.a' and 'ls X11/X11/X11 >X11.b' and diff them, I
get a couple garbage lines and no other difference between the two X11s
(the dirs contain very large number of files).

My guess is that all the X11s are pointing to themselves. Anybody know
why that's done?

(I found this yesterday when SLiM, my DM, wasn't coming up -- I'd
managed to delete the entire /usr/bin/X11. But startx was starting XFCE
with no X11 dir. I'm missing something...)

-- 
Glenn English

[toc] | [next] | [standalone]


#219441

FromGreg Wooledge <wooledg@eeg.ccf.org>
Date2020-02-25 21:30 +0100
Message-ID<zDP05-5jU-7@gated-at.bofh.it>
In reply to#219440
On Tue, Feb 25, 2020 at 01:23:19PM -0700, ghe wrote:
> What does, in /usr/bin/X11, 'X11 -> .' mean?

You mean this:

wooledg:~$ ls -l /usr/bin/X11/X11
lrwxrwxrwx 1 root root 1 Nov 23  2016 /usr/bin/X11/X11 -> .


Note how unclear your description is, and how clear mine is.  Show
the actual COMMAND you run and the actual OUTPUT of the command.

Choose a command that gives you the desired output, which is clear
and concise.  A few years of experience with the basic Unix tools
should give you some facility in this department.


This is a symbolic link.  You can tell because of the "l" (for "link")
in the very first column of ls -l's output.


Now... your question, I take it, is, "WHY on earth is there a link
from /usr/bin/X11/X11 to /usr/bin/X11?"

Probably historical reasons.  Backward compatibility with something.

Why do you care?  Just ignore it.

[toc] | [prev] | [next] | [standalone]


#219449

FromCharles Curley <charlescurley@charlescurley.com>
Date2020-02-26 06:40 +0100
Message-ID<zDXAm-2ct-17@gated-at.bofh.it>
In reply to#219441
On Tue, 25 Feb 2020 15:29:02 -0500
Greg Wooledge <wooledg@eeg.ccf.org> wrote:

> Show
> the actual COMMAND you run and the actual OUTPUT of the command.

Indeed. The only thing I would add is show the next prompt so that the
reader knows you've given all the output, not just the first line.

charles@jhegaala:~$ ls -l /usr/bin/X11/X11
lrwxrwxrwx 1 root root 1 May  3  2017 /usr/bin/X11/X11 -> .
charles@jhegaala:~$

Anyone familiar with Unix would know that your example has only the one
line of output, but that isn't always the case.


-- 
Does anybody read signatures any more?

https://charlescurley.com
https://charlescurley.com/blog/

[toc] | [prev] | [next] | [standalone]


#219483

FromDavid Wright <deblis@lionunicorn.co.uk>
Date2020-02-26 17:20 +0100
Message-ID<zE7zH-Mz-1@gated-at.bofh.it>
In reply to#219440
On Tue 25 Feb 2020 at 13:23:19 (-0700), ghe wrote:
> What does, in /usr/bin/X11, 'X11 -> .' mean?

That symlink is actually in /usr/bin/, so your example here
has already followed it once.

> Looks to me like it means 'link <here> to <here>'

Indeed. This means that an old script which tries to run
/usr/bin/X11/foo will succeed in running /usr/bin/foo,
which is where foo will have been placed.

[ … snipped various exercises in following symlinks … ]

I'm performing a thought experiment here.

> When I do 'ls X11 >X11.a' and 'ls X11/X11/X11 >X11.b' and diff them, I
> get a couple garbage lines and no other difference between the two X11s
> (the dirs contain very large number of files).

If   ls X11   worked, then your working directory is presumably
/usr/bin or /usr/bin/X11…, so you're doing this as root, and are
writing the output to a file in /usr/bin, so the file will include
an entry for X11.a. Likewise, the second command will contain
entries for X11.a and X11.b. Is that the "garbage" showing in diff?
Hence the importance, stressed by others, of showing your commands
(with their prompts) as well as the actual output.

> My guess is that all the X11s are pointing to themselves. Anybody know
> why that's done?
> 
> (I found this yesterday when SLiM, my DM, wasn't coming up -- I'd
> managed to delete the entire /usr/bin/X11.

In other words, a single symlink.

> But startx was starting XFCE
> with no X11 dir. I'm missing something...)

I have no idea whether your system has any *reliance* on the symlink.
It just depends on what's installed, and of what vintage.

If you go back in time, the X11 system was segregated in its own
directories under such names as X11R5, X11R6 and X386, so its
binaries would be in, say, /usr/X11R6/bin and its libraries …
You get the drift.

As X11 evolved, symlinks like /usr/bin/X11 → /usr/X11R6/bin were
made so that scripts could use the newer names. Now *those* scripts
are out-of-date as everything is in /usr/bin, so the link allows
them still to work. Similar skullduggery was going on under /etc,
/usr/lib and /usr/include etc.

On the down side, it made running two different versions of X, say
X11R6 and XFree86, on the same system next to impossible.

You may be running a system where even /bin and /sbin have ceased
to exist as directories, and are merely symlinks to /usr/bin and
/usr/sbin. Evolution? Tidying up? …

Cheers,
David.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web