Friday, April 26, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 391  / 3 Years ago, sat, june 12, 2021, 7:55:42

So I'd like to add always a folder to the Path. I'm not a huge linux wizard but I think I would need to always write the "export PATH=$PATH:(directory)" line when I log in. But I need this to be on when I'm starting up, and I don't want to bother with Terminal everytime.
So looking into it a little, I found that i should add that to .bash_profile even though I'm not sure what it is or where it's located. In the home directory there's only a .bashrc file.
Hope you can help me, thanks


More From » bash

 Answers
2

Add path to variable $PATH



As your comment says... you are running Lubuntu. Then to add a new Path to your $PATH you can try this:



1) Open a Terminal and type:




  • gksudo leafpad /etc/environment



(The /etc/environment file contains variables specifying the basic environment for all processes)



enter image description here



2) In my case I added the path :/home/user/bin after /usr/local/games



enter image description here



So the content of my PATH is:




  • PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/user/bin"



3) Then just logout and login to see the changes.



Add script to startup



1) Open a Terminal and type.




  • gksudo leafpad /etc/xdg/lxsession/Lubuntu/autostart



Then you can add a command.



My case is "test" script: @bash /home/virtual/Desktop/test



enter image description here



2) Then just logout and login to see the changes.


[#30051] Saturday, June 12, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
poefor

Total Points: 379
Total Questions: 95
Total Answers: 115

Location: Serbia
Member since Tue, Jul 26, 2022
2 Years ago
;