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.
The 'bin' in
is a directory. Some distros will have a bin/ directory in each users home directory and setup the $PATH variable to include it if it exists. I have a number of short scripts that I have written and this is where I put them.
First, read through the startup scripts section 'info bash' . It explains which files are read when you login, and which files are read when you simply open a new shell.
Second, find out which of these scripts are used on your system, and read through them. Often, one script will test for others and source them if they exist. ( Sourcing a script runs it in the same shell instead of a subshell, so variable changes are retained when it finishes. ).
You may for example have a /etc/profile on your system. On SuSE Linux, the comments near the top explain that you shouldn't touch this file but make additions to /etc/profile.local instead. So somewhere in '/etc/profile is a test for the /etc/profile.local which sources it if it exists.
If you want to make global PATH or alias changes, find out where your system currently sets them, and make your additions in the same place. For example, in Mandrake Linux, there is an 'aliasesrc' script that is sourced. Editing this file will change the aliases for all users.
Backing up a bit, I should explain why adding '.' to the PATH variable is not a good idea. Suppose you are in a directory that has world write permissions, and another user or a hacker had added a program called 'ls' which will wipe out your home directory. You don't know this and enter 'ls' to get a listing of the files in the directory. If you have '.' in the source path, then the 'ls' script in the current directory will run instead.
There are actually two lessons here. First, don't have '.' in your path. Second, world writable directories should be on partitions mounted with the 'noexec' and 'nodev' options. This is one reason why a server style setup will have a number of partitions, so that they can be mounted with different options to maximize security.