Monday, April 29, 2024
22
rated 0 times [  22] [ 0]  / answers: 1 / hits: 179525  / 3 Years ago, fri, september 10, 2021, 8:18:41

I added a directory path to system path($PATH) by running,



export PATH=$PATH:/home/avinash/Desktop/raj


Now my path look like this,




$ echo $PATH
/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/avinash/Desktop/raj


I want to remove /home/avinash/Desktop/raj from system path variable by using command(like export command does on adding path).


More From » command-line

 Answers
7

Running export PATH=$PATH:/... doesn't set your PATH system-wide. It's just a shell variable. Start a new shell and BOOM, it's gone. Obviously if you've added that to ~/.bashrc (or another environment bootstrap file) you'll have to revert that change but it doesn't sound like your problem here.



If you're desperate not to start a new shell, you could set it by removing it manually, with:



export PATH=/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

[#26552] Saturday, September 11, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
izecaptur

Total Points: 113
Total Questions: 102
Total Answers: 114

Location: Northern Mariana Islands
Member since Fri, Jan 15, 2021
3 Years ago
;