If you’re using the fantastic Ubuntu Bash terminal in Windows 10 which gives you a proper Ubuntu Linux terminal window and subsystem, you’re probably wanting to access files on your main drive.
To get to your C drive which has your files, you can just type:
I don’t know about you, but typing that is painful. By creating an alias in your
.bashrc file which is a configuration file for the Ubuntu terminal instance, you can create a shortcut to the C drive (and other mounted drives as well).
Go into your home directory by typing:
Then open up your
.bashrc file in the Nano text editor by typing:
Go all of the way to the bottom and add in an alias. I called mine
cdrive but you can call yours whatever you want:
alias cdrive='cd /mnt/c'
ctrl+x to exit the text editor. You’ll be asked if you want to save your changes, type
Y and hit enter. Lastly, we need to tell the current terminal window about our changes by typing:
Now test your alias by typing
cdrive (or whatever you called it). You should be taken to your main drive. That’s it.