Mailinglist Archive: opensuse (3318 mails)
|< Previous||Next >|
Re: [opensuse] odd /usr/bin thing
- From: Aaron Kulkis <akulkis00@xxxxxxxxxx>
- Date: Wed, 09 Jan 2008 00:52:46 -0500
- Message-id: <4784612E.2080803@xxxxxxxxxx>
Bill Anderson wrote:
> Aaron Kulkis wrote:
>> Bill Anderson wrote:
>>> Aaron Kulkis wrote:
>>>> Bill Anderson wrote:
>>>>> Bob S wrote:
>>>>>> Hello SuSE users,
>>>>>> While searching for files in /usr/bin I noticed something that seems odd to me. There is a folder in there named X11. It is a link to the same folder. If you open it, it shows the exact same thing as /usr/bin. You can continue opening the X11 directory until you have a /usr/bin//X11/X11/X11/X11 file open on ad-infitum. They all show the exact same files and megabytes. What is this? Can somebody explain the purpose?
>>>>>> Bob S
>>>>> Not sure of the reason, but it only impacts on the logical path pwd -L. The physical path (pwd -P) remains as /usr/bin. The impact is to have all X11 binaries appear in /usr/bin instead of /usr/bin/X11. Like many symbolic links, it makes the applications happy even when the underlying structure changes. For those of us who use UNIX, we are used to /bin being a symbolic link to /usr/bin,
>>>> since when? there are several programs which have always
>>>> been in /bin because they are needed in runlevel 0 and
>>>> run level S, neither of which have /usr mounted, but which
>>>> are not administrative only, (and thus do NOT reside in
>>>> /sbin or /usr/sbin).
>>> Since the early 1990s, /bin has been a symbolic link to /usr/bin. If you go to runlevel S, you will find that there are a minimal number of utilities in /usr/bin. These are hidden if you have a separate mount for /usr. The intent was for /usr to be a static directory.
>> I think you're on drugs:
>> akulkis@kulkix:/> ls -al /
>> total 112
>> drwxr-xr-x 23 root root 4096 2007-12-18 15:26 .
>> drwxr-xr-x 23 root root 4096 2007-12-18 15:26 ..
>> drwx------ 2 root root 4096 2007-01-09 05:54 .gnupg
>> lrwxrwxrwx 1 root root 6 2007-04-23 12:24 K00ntp -> ../ntp
>> lrwxrwxrwx 1 root root 6 2007-04-23 12:24 S99ntp -> ../ntp
>> drwxr-xr-x 2 root root 4096 2006-12-27 11:39 bin
>> drwxr-xr-x 3 root root 4096 2006-12-27 11:39 boot
>> drwxr-xr-x 11 root root 7880 2008-01-07 01:32 dev
>> drwxr-xr-x 120 root root 8192 2008-01-07 05:34 etc
>> drwxr-xr-x 31 root root 4096 2007-12-15 20:17 home
>> drwxr-xr-x 11 root root 4096 2006-12-27 11:39 lib
>> lrwxrwxrwx 1 root root 11 2006-12-26 10:58 local -> /home/local
>> drwx------ 2 root root 16384 2006-12-26 08:38 lost+found
>> drwxr-xr-x 6 root root 4096 2008-01-07 05:31 media
>> drwxr-xr-x 3 root root 4096 2007-07-15 12:36 mnt
>> drwxr-xr-x 17 root root 4096 2008-01-05 00:12 opt
>> dr-xr-xr-x 290 root root 0 2008-01-07 01:22 proc
>> drwx------ 25 root root 4096 2008-01-07 01:32 root
>> drwxr-xr-x 3 root root 8192 2006-12-27 11:43 sbin
>> drwxr-xr-x 5 root root 4096 2006-12-26 09:31 srv
>> drwxr-xr-x 2 root root 4096 2006-04-22 22:25 subdomain
>> drwxr-xr-x 11 root root 0 2008-01-07 01:22 sys
>> drwxrwxrwt 133 root root 16384 2008-01-07 15:00 tmp
>> drwxr-xr-x 12 root root 151 2006-12-26 09:02 usr
>> drwxr-xr-x 15 root root 4096 2006-12-27 11:35 var
>> drwxr-xr-x 3 root root 4096 2006-12-26 08:38 windows
>>>> examples being: cp, chown, dd, grep, awk, cat, chmod, chgrp,
>>>> date, kill, ln, ls, mount, umount, rm, rmdir, sed, stty,
>>>> tar, shells (sh/ksh/csh/tcsh/bash), false, true, uname,
>>>> ed, ex, vi
>>> I think you need to get on a Unix box, and check out the actual structure. Linux has never followed this path, and holds to the old Unix structure. I have been working with Unix since 1978, and have been through a number of file structure changes.
>> Which Unix vendors made this change?
>>> The point is that symbolic links are used to for backwards compatibility.
>> Yes, I realize that.
>>> As a side light, a number of the utilities that you mention are now shell built-ins, which take precedence over the equivalent command. For example, pwd is a built-in that has the -L and -P options for ksh and bash.
>> Primarily because forking off a shell, then execing a new
>> executable, just to print the name of the working directory
>> is a waste, and belongs in the shell.
>> /bin/pwd was basically a patch for a deficiency in the
>> early versions of sh and ksh.
>> Csh and tcsh have always had $cwd (current working directory)
>> > The /usr/bin command does not have these options, and exists for
>>> Bourne shell compatibility. You might also note that under Linux it is /usr/bin/sh, /usr/bin/ksh, and /bin/bash.
>> Now I know you're on drugs:
>> akulkis@kulkix:/> which sh
>> akulkis@kulkix:/> which ksh
>> akulkis@kulkix:/> which bash
>> akulkis@kulkix:/> ls -al `which sh`
>> lrwxrwxrwx 1 root root 4 2006-12-26 08:43 /bin/sh -> bash
>> akulkis@kulkix:/> ls -al `which ksh`
>> lrwxrwxrwx 1 root root 12 2006-12-27 11:39 /usr/bin/ksh -> /lib/ast/ksh
>> akulkis@kulkix:/> ls -al `which bash`
>> -rwxr-xr-x 1 root root 501804 2006-04-22 21:46 /bin/bash
>>> Most people are not aware that the default behavior for ksh
>>> and bash is to show the logical path, so that cd .. behaves
>>> as expected. It is the shell that tracks the logical path.
>>> The system calls still refer to the physical path, as does
>>> /bin/pwd. For those interested in understanding this behavior
>>> try cd -P /usr/tmp and then do the pwd command. The shell
>>> built-in for cd also support the -P and -L options.
>>> Bill Anderson
> Sorry kid, you are just way to young as you obviously belong
I've been using Unix since the PDP-11/VAX-11 days of version 7
and 4.2 BSD
> to the drug generation. You could have at least had the
> courtesy of stating the system from which you derived the
> above listings. As they don't match either AIX or Solaris.
> It does appear that ksh was installed separately,
Seems very very strange. A lot of AIX and Solaris systems are
still installed with /usr on a seperate partion from the root
filesystem. At least at GM, Ford, and when I was at KMart
a couple years before they folded.
> as it appears under /lib/ast.
> Insults are much easier than courtesy.
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx
|< Previous||Next >|