kalaisuresh appears to be using bash as his shell, so:
$
echo $PATH
should work fine to show the path. Let's suppose the result looks like this:
- [prn@deimos ~]$ echo $PATH
-
/usr/lib/qt-3.3/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin
-
A sensible thing to do (and commonly done) would be to create a "bin" directory for storing personal programs. If so, I might create a directory as /home/prn/bin and put a program, e.g., like his
c into that directory. Now I want to make sure that when I type "c[enter]" at my prompt, that
my program c is the one that is executed. (In this example, there probably isn't a system equivalent, but just to be sure, it would be wise to check. Use the command
which c
to see if the system would find another program of the same name on your PATH).
Now you you want to make sure that your system will always find your program
c for you. Edit your
.bash_profile and, toward the end, include a line like:
PATH=$HOME/bin:$PATH
this puts the directory /home/bin/prn (after all, this is my example and I know what my login is -- I'm less sure about yours :)) at the beginning of my path. Whatever your login name is, it will put YOUR bin directory, i.e., the one hanging off your $HOME at the beginning of your path.
Now, after
(to rerun your profile script):
- [prn@deimos ~]$ echo $PATH
-
/home/prn/bin:/usr/lib/qt-3.3/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin
-
/home/prn/bin is now the first place my shell will look for programs.
Of course, in the case of something so simple, it would probably be a lot easier to put a line like
into your
.bashrc file.
There is one additional comment I feel almost compelled to make and that involves the line
root>c
from the original post. I hope that doesn't mean what I think it does. It's a really good idea NOT to be root all the time. Make sure you have a normal user account and generally use that. If you're not sure why, that's probably a good topic for another thread.
Best of Luck,
Paul