-   Linux - Newbie (
-   -   Program files and directory structure (

Carel 04-09-2001 03:05 PM

I installed Linux last week and got a few Linux books.
Have not been able to find info on how program "paths" are handled. In DOS one either has to be in the directory where the program resides or one has to specify a path in the autoexec.bat file. Could someone please direct me to some info on how this works in Linux?

trickykid 04-09-2001 03:28 PM

Usually you type the full path of where the program resides or if your in the directory already. You can also create aliases and such.
Most of the time, I am in the directory on which the program is in and type ./program-name-here

Hope this helps.

Carel 04-09-2001 10:39 PM

Thanks for that explanation. I am still a little bit mystified though: For instance the command mkbootdisk is in the directory /sbin, but when I am in the root-directory it will run anyhow. So is there some equivalent of a DOS "path" command in Linux?

Copenhagen Cowboy 04-10-2001 08:28 AM

The reason it will run from the root directory is because it is already set as an alias. You can check for sure by typing "alias" at the prompt.

NGene 04-11-2001 07:03 AM

There is a file where the PATH and aliases are specified. It may be a file called .bashrc or .bash_profile in your home directory, or it can be /etc/bashrc. I'm posting this from a Winblows machine so I can't check for the exact file name but I think it's one of these.

Carel 04-11-2001 11:57 AM

Thanks to the three above who answered. That explains most of it. I am still curious though, how the root knows if it should look for .bash_profile or /etc/bashrc. There has to be SOMETHING that specifies where root should look...? Or does it first look for .bash_profile and if that is not there it looks for /etc/bashrc. I am trying to get some basic understanding for the mechanics here. Because I don't know how this stuff works under Linux, I had to spend a lot of time to figure out that giving a command from the /root is different from doing it from root@localhost /root. (I still don't know why). I could not get mkbootdisk to work from root@localhost but finally got it to work by logging in at the root. If this sounds confused it is because I am..

All times are GMT -5. The time now is 03:50 AM.