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.
Well, the issue here is "/usr/local/bin" and "/usr/sbin"
These directories hold binary programs such as "ls" or the forementioned "java" and since they are in this directory they are accessible by simply typing them without that nasty "./"
"./" simply means ... run from this directory. i.e. ./randomprogram = please run the binary file randomprogram from this directory.
So, if you want to NOT have to type "./program" you will have to copy the binary file into the /usr/local/bin/ directory.
ok, take a look at a variable that is set automatically for linux:
PATH
to show its content, type "echo $PATH"..
you'll see a list of directories separated by a ":"
every executable that is in one of those directories will be executed if you just type their names..
for example /sbin/lilo is an executable, and /sbin is in the PATH..
you just have to type lilo and it's executed
If you want to add your own directory to the PATH, do this:
PATH="$PATH:/mydirectory/"
but that applies only for your current session, if you want it to apply for all the others,
you have to edit the file /etc/profile..
search for the lines containing the PATH content and add your dir to this group of dirs..
DON'T forget that the directories must be separated by ":"
uhhhh, no. I'm gonna warn you though this could be considered a security risk by some. Anyway, what you want to do is add the current directory in your PATH ( but it will always be the current directory, not a static directory like "/home/programs/bin" or something like that). Some distro's do this and some do not. here is what you need to add to /etc/profile:
# For non-root users, add the current directory to the search path:
if [ ! "`id -u`" = "0" ]; then
PATH="$PATH:."
fi
If you use these programs often, you can add it into the
menu or create a desktop icon.
Menu:
-> K (window equivalent of start)
-> Appl...
-> System
-> Menu Editor
[could be be diffenrence based on distribution)
Icon:
wiggle to executable on a file manager
Left-click and hold and drag to desktop.
choose to link.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.