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!
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Yes, the way Linux manages executables is much different than in MS-DOS (I'm assuming that this is where you're coming from). In Linux, you can only execute commands that are in certain directories, such as /bin, /sbin, /usr/bin. These directories are contained in the PATH variable. You can see this list by typing:
$ echo $PATH
This makes it very easy to execute commands from wherever you are in the directory tree without having to cd to the directory that contains the executable, or having to type out the whole path name. If you want to execute a command that is not in one of these designated directories, you have to type the absolute path name (eg /usr/program/myprogram or ./myprogram, if you are in /usr/program already). While this might seem like an inconvenience, it prevents you from accidentally executing files in the current directory when you really wanted to execute a generic system command. For example, it prevents someone from creating a trojan named "ls" which would be run whenever you wanted to use the ls command. It also prevents commands from behaving differently depending on which directory you are in.
Thanks so much for the answer! I've been reading about Symbolic Links, which is another new topic that seems related.
For example, when I installed firefox I put it in /usr/firefox. To run the firefox program, rather than adjusting the PATH variable to add /usr/firefox or having to cd /usr/firefox and then run ./firefox, I could create a symbolic link in /usr/bin for firefox?
You could edit your user .bashrc or .bashrc_profile (different distros have different names for it) to add an alias. Such as: alias firefox="/usr/firefox". Then, everytime you boot up, the command is available to you by simply typing firefox and pressing enter.
To make such an alias available to all users, edit the /etc/bashrc to add the alias there. Be adivsed that, on upgrading your distro, the system bashrc may be overwritten, in which case you could loose all of your aliases. In other words, keep a backup copy, which you can then cut and paste your aliases into a changed bashrc.