Jump to content

In ubuntu 22.04 - adding a permanent custom environment path variable didn't work (it doesn't return the directory when i try to use new variable $XXX in cd command)


Recommended Posts

 I followed this tutorial: https://youtu.be/JLjF75b-vMI?t=127 to create a permanent environment path variable in ubuntu 22.04 LTS

 

the above tutorial basically runs the the command

xxxx@XXXXXX:~$ vim ~/.bashrc

which returns a file and to the end of which i added these two lines:

export HOU=/media/xxxx/System/___HOU
export PATH=$PATH:$HOU

then wrote and quit the file by pressing "shift :" then "wq" and then enter

 

...and it worked fine exactly how it was showed in the tutorial, however when i ran "cd $HOU" (it changed directory, however after i reboot, it doesn't seems to work anymore...)

xxxx@XXXXXX:~$ echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/media/xxxx/System/___HOU

xxxx@XXXXXX:~$ echo $HOU /media/xxxx/System/___HOU

xxxx@XXXXXX:~$ cd $HOU bash: cd: /media/xxxx/System/___HOU: No such file or directory xxxx@XXXXXX:~$

 

PS: i a noob in linux and ubuntu, i would appreciate a ton for any help

Edited by demoan666
Link to comment
Share on other sites

  • demoan666 changed the title to In ubuntu 22.04 - adding a permanent custom environment path variable didn't work (it doesn't return the directory when i try to use new variable $XXX in cd command)
On 1/6/2023 at 4:54 AM, bunker said:

check this directory exist: "/media/xxxx/System/___HOU", you can just do:

cd /media/xxxx/System/___HOU

also you can double check the path is still in your bashrc:

cat ~/.bashrc | grep ___HOU

this retuens:
xxxx@XXXXXX:~$ cat ~/.bashrc | grep ___HOU
export HOU=/media/xxxx/System/___HOU (however the last ___HOU shows up in red)

 

and i can not cd to that path (which was working earlier once):

xxxx@XXXXXX:~$ cd /media/xxxx/System/___HOU
bash: cd: /media/xxxx/System/___HOU: No such file or directory

but if i manually go to that directory and open up a terminal by right clicking i get this:
xxxx@XXXXXX:/media/xxxx/System/___HOU$

 

Link to comment
Share on other sites

On 1/8/2023 at 4:39 AM, bunker said:

so the environment variable works.
Looking at the name of the directory "System" I'm guessing you're trying to access a Windows drive.
Try a Linux partition instead. I don't use Windows, maybe someone else can help :lol:

thanks a lot bunker, yes, i am trying to access my windows drive, and i would like to access that location the reason is i am trying to setup a common folder which doesn't need to be messed  irrespective of OS i am using or reinstalls or when i am working in an entirely different machine. i can still access my common asssets/ packages etc from one cloud location by feeding it the same location. I hope comeone can figure this and let me know if i am not banging my head on the wall :D 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...