LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Command promt question (https://www.linuxquestions.org/questions/linux-newbie-8/command-promt-question-147608/)

lozz1978 02-18-2004 11:08 AM

Command promt question
 
This is hard for me to explain as im not quite sure what im on about, here goes,

At the moment for me to start amsn from a promt i have to type the full path. [piresl@localhost piresl]$ msn/msn/amsn

what i want to be able to do is, just type amsn at the promt instead of typing the complete path,

I guess i have to create a link (sym link) to some directory, but im not sure which one ?

can anyone help me ?

cheers

DrOzz 02-18-2004 11:15 AM

read this little article
and when you get to the part about adding another directory after the colon : you will add:

/home/piresl/msn/msn/

if that is in fact the directory structure, although i can't see why you have two msn directorys .... but if that is how you got it, then thats what you will add ...

and if you did want to make a symlink to amsn in your home folder, then while in your home folder (/home/piresl) you can type :
ln -s msn/msn/amsn amsn

mwerle 02-18-2004 11:17 AM

To see your current search path, type: echo $PATH

You have 3 options:
1) Copy the executable in a directory on your path (usually if it's not a distribution-specific program but should be shared amongst all users on the machine this would be /usr/local/bin) - this has to be done as the 'root' user. (eg: cp <full path of executable> /usr/local/bin)
2) Symlink the executable to a directory in your path (same notes as for (1) but using ln -s <full path of executable> /usr/local/bin)
3) Edit your path to include the directory where the executable is (eg for bash shells: export PATH=$PATH:<directory where your file is> - note that it has to be the fully qualified path, not a relative path) You can automate this step by editing your shell configuration file (for bash, this is ~/.bash_profile) so that your path is set every time you log in.

Cheers,
Micha.

RolledOat 02-18-2004 11:27 AM

I guess that you are in your home directory where you enter that command, (pwd will clear that up), so likely, the exact commands below will work.

If you want any user to be able to execute it...
su - root
<enter password>
ln -s /home/piresl/msn/msn/amsn /usr/bin/amsn

otherwise, just for piresl,
open a console
cp .bash_profile .bash_profile_orig
pico .bash_profile (note any text editor to open the file)
navigate to the line like
PATH=$PATH:$HOME/bin
and change it to
PATH=$PATH:$HOME/bin:$HOME/msn/msn

NOTE: other users will not be able to run this unless they have access to your directory. If only you, it is a don't care. Why did you install it there instead of as root in /usr/bin or /usr/local/bin?

R.O.

lozz1978 02-18-2004 12:02 PM

I created a sym link in /usr/bin/ pointing to /home/me/msn/msn/amsn


this seemed to work for me, thanks again


lozz


All times are GMT -5. The time now is 12:48 AM.