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 testdir
creates a new directory calledtestdir
. -
cd <directory>
changes the directory you are in to the directory you specify. For example,cd testdir
moves you into thetestdir
directory.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.md
to open theREADME.md
file 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
-
ls
lists the items in your current directory -
rm <path/to/file>
deletes the file you specify- For example,
rm README.md
deletes theREADME.md
file 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.