I need to set a path for a variable $week4 to be Week4/assignment so that typing cd $week4 will change the working directory to Week4/assignment/
I've seen a few examples of similar stuff on here, but I haven't been able to make it work for me. Help is appreciated!
Since your path has spaces in it you need to enclose both the path AND the variable in
""
. Try this from the command line.Now you should be able to navigate to that directory by typing cd
$week4
If you want to make this permanent then add the same line to your
.bashrc
file.To do that you can add following in your
~/.bashrc
file .Open
~/.bashrc
file usinggedit ~/.bashrc
and add above in it an save it.Now you can use
cd $WEEK
to cd your folder