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.