Terminal commands
Navigation
Each of your terminal windows can view one directory/folder at a time. To view multiple directories, open more terminal windows.
You only need to learn a few commands to navigate your files in a bash terminal.
-
mkdir <directory>creates a new directory with the name you specify. For example,mkdir testdircreates a new directory calledtestdir. -
cd <directory>changes the directory you are in to the directory you specify. For example,cd testdirmoves you into thetestdirdirectory.cd ..moves you up one directorycd ../../moves you up two directoriescd ~moves you back to the home directory
-
nano <path/to/file>creates an editor at the file. For example, typenano README.mdto open theREADME.mdfile or to create one if it doesn't exist in that directory- Press Ctrl+O to initiate writing the file out
- Press Enter to write the file out
- Press Ctrl+X to close the file
-
lslists the items in your current directory -
rm <path/to/file>deletes the file you specify- For example,
rm README.mddeletes theREADME.mdfile rm -rf <directory>deletes the directory you specify
- For example,
Deleting files and directories in the Ubuntu WSL is permanent because there's no recycle bin.