Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I've done a search but I can't come up with the answer, probably because I don't know what exactly to be searching for.
I want to know how I can make a program name 'global' so I can call it from any directory instead of where the program resides, I suspect its going to be making a symbolic link to somewhere but I don't know where.
E.g. To use azureus I have to go 'cd /usr/local/bin/azureus then ./azureus'
to run firefox I have to type 'firefox' and away it goes.
While we're at it, any way to put this program into the applications menu?
Eh, so I take it you build a lot from source? I don't understand what's all the cd'ing for. Even then, I don't understand why you have to cd to /usr/local/src to run something. If you finish your compile with 'make install', and your path is correct, you should be able to run everything without having to cd.
Originally posted by Peleus I want to know how I can make a program name 'global' so I can call it from any directory instead of where the program resides, I suspect its going to be making a symbolic link to somewhere but I don't know where.
E.g. To use azureus I have to go 'cd /usr/local/bin/azureus then ./azureus'
to run firefox I have to type 'firefox' and away it goes.
What you are looking for in the PATH environment variable. Open a shell and type
Code:
echo $PATH
to see which directories are searched for the command you type (what you refer to as being 'global').
Assuming you use bash - find out this way:
Code:
blindcoder@ceres:~$ echo $SHELL
/bin/bash
you can add /usr/local/bin by adding the following line to the file ~/.bashrc
Code:
PATH="$PATH:/usr/local/bin"
Quote:
While we're at it, any way to put this program into the applications menu?
Running SuSe 10, thanks guys.
With KDE it should be in the ControlCenter. There should be an option "Menu Editor" or something like that. There you can add each and any items to the menu and remove others.
Ok, in regards to how I installed it, I decided that I'm putting my programs into /usr/local/bin because I read somewhere thats where people put them a lot of the time, probably wrong but either way it shouldn't hurt anything.
Now correct me if I'm wrong but with azureus you mearly download then untar it, which produces the program azureus which you just run with ./azureus, no need to make install etc to get the right path.
Since I have absolutely no idea what I'm doing with path can someone please fill me in with what the correct command exactly?
P.s. output of linux:~ # echo $PATH
/sbin:/usr/sbin:/usr/local/sbin:/opt/gnome/sbin:/root/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/games:/opt/gnome/bin:/opt/kde3/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin
my azureus program and files is located in /usr/local/bin.
Originally posted by Peleus
P.s. output of linux:~ # echo $PATH
/sbin:/usr/sbin:/usr/local/sbin:/opt/gnome/sbin:/root/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/games:/opt/gnome/bin:/opt/kde3/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin
my azureus program and files is located in /usr/local/bin.
That should work...
Now, can you do this and post the whole output here:
Code:
linux:~ # azureus
IE, start azureus not from the /usr/local/bin directory but from somewhere else.
okay, here we go.
/usr/local/bin/azureus is not a program but a directory. I suggest doing the following:
Install Azureus to /opt/azureus. Then create the following symlink:
Code:
ln -sf . /opt/azureus/bin
After you logout and login again you should be able to run azureus without having to cd to the path.
What happens:
/opt/*/bin are automatically added to the PATH environment variable which is searched by your shell for programs. By having azureus in /opt/azureus and creating the symlink from /opt/azureus/bin to /opt/azureus the name /opt/azureus/bin/azureus will point to the executable program /opt/azureus/azureus.
Firstly I'd like to say thanks for your help you're being awesome.
Secondly I tried without any success.
Firstly I moved /usr/local/bin/azureus to /opt/azureus
I then created the symlink cut and pasting the command you said, now the output when I type is
peleus@linux:~> azureus
bash: /usr/bin/azureus: Permission denied
Was the symlink ment to be for /opt/azureus/bin though because all my azureus files are in that azureus folder, none in bin, you probably did say the right command but thought I would double check.
linux:/usr/bin # ls -l "azureus"
-rw-r--r-- 1 peleus users 75 Nov 9 01:20 azureus
Originally posted by Peleus Firstly I'd like to say thanks for your help you're being awesome.
Thanks, I need that from time to time
Quote:
Secondly I tried without any success.
Firstly I moved /usr/local/bin/azureus to /opt/azureus
I then created the symlink cut and pasting the command you said, now the output when I type is
peleus@linux:~> azureus
bash: /usr/bin/azureus: Permission denied
Was the symlink ment to be for /opt/azureus/bin though because all my azureus files are in that azureus folder, none in bin, you probably did say the right command but thought I would double check.
Okay, what we have here is another problem.
There seems to exist a file/directory /usr/bin/azureus, possibly from your Distribution or an older azureus installation.
You said you use SuSE, so I suggest checking with YaST and possibly deinstalling the older version.
Please also paste the output from
Ok, well firstly in regards to the old install as far as I can tell there never has been any install on the system. If I go yast > software management and search for azureus no results come up. This is a fresh install from today and I know that I haven't put any previous installation on.
Originally posted by Peleus Ok, well firstly in regards to the old install as far as I can tell there never has been any install on the system. If I go yast > software management and search for azureus no results come up. This is a fresh install from today and I know that I haven't put any previous installation on.
Okay, in that case it should be safe to just delete /usr/bin/azureus. Maybe you should just move it somewhere else first to check if everything still runs and then delete it.
Quote:
In regards to the output,
peleus@linux:~> ls -l /opt/azureus/
lrwxrwxrwx 1 root root 1 2005-11-09 01:51 bin -> .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.