You haven't said which OS you are on, but i suppose it is some kind of Linux.
Notice, that there are two files: /etc/profile and/or /etc/bash.bashrc. These are systemwide settings and changing these will alter your system, so stay away from them as long as you are not sure what you do and how you do it.
Then there is "/your/home/.profile" and "/your/home/.bashrc". These files are only executed by you and you can - more or less - do whatever you want with them. The worst you might do is make login or execution of the shell for yourself impossible - log on as root, remove the offending files or replace them with some backup copy and you are again ready to go. You might want to create a separate "test user" for that purpose and experiment with the startup files for this account. Once you are satisfied you copy the files from there to your own home and use them.
Now to your initial question: "$PATH" is a list of directories, separated by colons (":") which are searched for executable files if no complete path is entered. A common PATH variable might look similar to this:
If you now enter "command" at the command line these directories are searched in the order they appear in this variable for a file which is executable and named "command": first "/bin/command", then "/usr/bin/command", etc..
Once such a file is found, it is executed. By changing the order within "$PATH" you can influence which executable (if there are several named identically) is executed. If you put "/your/home/bin" in front of your PATH by executing
an executable named i.e. "/your/home/bin/cp" would "override" (take precedence over) the system command "cp", usually located in "/usr/bin/cp".
This is sometimes a wanted effect, sometimes not. You decide what you want here. You just need to know that writing "$PATH" is like typing the complete current value of the PATH variable, therefore, taking the above mentioned value as example:
I have a build where I wish to link against and load a specific version of a library and a different version of the same library is installed on the system. I'm using a -L option to point to the version that I wish to link against but gcc still seems to choose the installed version. Is there a way... (4 Replies)
Q1. I understand that /usr/local/bin means I can install/uninstall stuff in here and have any chance of messing up my original system files or effecting any other users. I created this directory myself.
But what about the directory I didn't create, namely /Users/m/bin? How is that directory... (1 Reply)
Hi,
I have a problem I don't understand with fuser.
I launch a simple shell script mysleep.sh:
I launch the command fuser -fu mysleep.sh but fuser doesn't return anything excepted:
mysleep:
Then I modify my script switching from #!/bin/sh to #!/bin/ksh
I launch the command fuser -fu... (4 Replies)
Hello
I using CygWin and am working on project that requires whereby after I make some code changes and rebuild I have to manually copy the updated files into the install directory to test them. There is a build output directory where these files placed, but the program will not run from there.... (4 Replies)
Hi, I need
to make some extraction . with the following input to get the right output.
input: /etc/exp/home/bin ====> output: exp
and
input: aex1234 ===> output: ex
Thanks for your help, (4 Replies)
hello everybody,
I am trying to find the path of the Recycle Bin. I know that it's a temporary storage place, but it should have a path that we can refer to.
I want to know it because I sometimes use cygwin to work on Windows, and when you delete something with it, it's gone. I just checked... (4 Replies)
i wrote a script and is running. I add the path bin to variable PATH, i.e.
PATH=$PATH/bin. i add this to PATH in order to run the script in any path working directory. Thats ok. The problem is as son as i close the session and start a new session, changes are lost. How can i tell the shell or... (1 Reply)
I want to add a default path /bin/mycommands along with others to be loaded as default path for all new accounts created on my system . With out the new accounts not having to change thie manually to /bin/mycommands.Do I change the /etc/profile ? is there any better way?
Please throw some... (2 Replies)
Is it unsafe to put your own home directory (a regular user) in your search path? I am writing useful shell scripts, but don't have the permissions to put them in /usr/bin. (Korn shell)
thanks (2 Replies)