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.

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.

when I su the root privilege, the $PATH variable changed
which file control this variable, it's different between su $PATH and login root $PATH, I thought they should be the same, but it's not.
excuse for my poor english, here is the example

Originally posted by contrasutra your universal PATH (the one that all users can use) is located in /etc/profile

that users specific path is located in ~/.bash_profile or ~/.bashrc

~ = The users Home directory.

I am looking at both these files to in order to add some things to my path. What is the difference between them? Is it preferable to use one over the other for certain situations?

I was also looking at the universal profile too (I'm adding java to my path if it makes a difference), I'm the only user on my computer, but I may well want root to have access to the same things I do. I was just a bit scared to change the universal profile because what is there already is doing some checking via if statements before adding bits to the path. I don't quite understand yet what is going on well enough to do that kind of checking. I guess it's checking to see if certain files or directories exist before adding them to the path.