PATH settings don't seem to persist across sessions


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers PATH settings don't seem to persist across sessions
# 1  
Old 09-27-2011
PATH settings don't seem to persist across sessions

I recently installed LaTeX on my linux machine and I attempted to add a directory to the PATH as the instructions say to do. They tell me to give the following command:
Code:
PATH=/usr/local/texlive/2011/bin/i386-linux:$PATH; export PATH

After I do this I can use commands such as "pdflatex" anywhere, but if I close that terminal and open a new one, it's as if I never added that to the PATH. That directory no longer shows up when I give the command "echo $PATH".
I have read multiple sources regarding this process and they never mention my problem. I am pretty new to linux so I don't have any clue what's happening. Any help would be appreciated.
# 2  
Old 09-27-2011
you have to add that to either of these files depending on your linux distro


these are usually under /root

.profile, or .bash_rc or .bash_profile file
# 3  
Old 09-28-2011
Quote:
you have to add that to either of these files depending on your linux distro


these are usually under /root

.profile, or .bash_rc or .bash_profile file
If you add the entry into the /etc/profile file then it will remain persistent between all sessions for all users, you should not be using /root for running programs, you should have other users created with sudo access so they will need to have this directory in their PATH too.
# 4  
Old 09-28-2011
Quote:
Originally Posted by karlochacon
.profile, or .bash_rc or .bash_profile file
I think you mean .bashrc
# 5  
Old 09-28-2011
Thanks to those that replied

I tried adding the lines to /root/.bashrc and /root/.bash_profile but that didn't do anything.
I looked at /etc/bashrc and /etc/profile and neither of them seemed like the appropriate places to be putting that stuff (b/c system-wide functions and were being defined and I didn't wanna mess anything up).

Finally I looked again and found a couple promising looking files in my home folder. When i added the lines above to ~/.bashrc it worked!

From the replies I assume that this means that these PATH settings will not be usable for all users?
# 6  
Old 09-29-2011
Quote:
I looked at /etc/bashrc and /etc/profile and neither of them seemed like the appropriate places to be putting that stuff (b/c system-wide functions and were being defined and I didn't wanna mess anything up).
These are no different to the ~/.bashrc or ~/.bash_profile, they just get applied to all users, as long as you append to the bottom of them you wont break anything. And they are not setting any system functions, it is all settings in a users environment.

If you use the local profile to set the PATH settings you need to do it for each user you want to have access to.

Code:
echo "PATH=/usr/local/texlive/2011/bin/i386-linux:$PATH; export PATH" >> /home/username/.bashrc

and just change the username, instead of manually doing vi on each script.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Command to see the logical volume path, device mapper path and its corresponding dm device path

Currently I am using this laborious command lvdisplay | awk '/LV Path/ {p=$3} /LV Name/ {n=$3} /VG Name/ {v=$3} /Block device/ {d=$3; sub(".*:", "/dev/dm-", d); printf "%s\t%s\t%s\n", p, "/dev/mapper/"v"-"n, d}' Would like to know if there is any shorter method to get this mapping of... (2 Replies)
Discussion started by: royalibrahim
2 Replies

2. Solaris

Delete route so it does not persist after reboot

Solaris 10 I am trying to delete a route using the command: route -p delete 192.0.0.0 192.1.3.254 The route gets delete but for some reason the route pops back up in the routing table after reboot. I also deleted the /etc/inet/static_routes file and the route still persists after reboot.... (6 Replies)
Discussion started by: jastanle84
6 Replies

3. UNIX for Dummies Questions & Answers

Exceed - Session Persist after shutdown

I'm wondering if it is possible to use Exceed as a remote desktop and have my session persist after I close it down (ala VNC Viewer). I find it annoying to always have to reopen my windows and files when I shut it down. Thanks! (0 Replies)
Discussion started by: dvd7e
0 Replies

4. Shell Programming and Scripting

Find zero byte file but don't need path

Just i want to ask How to search and display name of zero byte file I have used find command but it is showing complete file path Thanks find . -size 0 giving me zero byte file with location 1)/home/user/a (4 Replies)
Discussion started by: vivek1489
4 Replies

5. AIX

tuning network parameters : parameters not persist after reboot

Hello, On Aix 5.2, we changed the parameters tcp_keepinit, tcp_keepintvl and tcp_keepidle with the no command. tunrestore -R is present in inittab in the directory /etc/tunables we can clearly see the inclusion of parameters during reboot, including the file lastboot.log ... (0 Replies)
Discussion started by: dantares
0 Replies

6. Solaris

effect of change of mpd preferred path settings

Hello All, In the output of the command "mpdcontrol -no xlist", I found that, some of the preferred paths are marked as "err". You can see the output below: # mpdcontrol -noxlist Unit Dev# MPD_ID/Policy DeviceName FC_AL DevMajMin IOcnt State... (0 Replies)
Discussion started by: sundar3350
0 Replies

7. Shell Programming and Scripting

PATH variable settings

The contents of My PATH variable gets printed more than once if get it using the command echo $PATH Is there any way to set it right (5 Replies)
Discussion started by: preyan
5 Replies
Login or Register to Ask a Question