2.1 Create and change directory: mkdir, cd

Normally when we want to make a new directory, we would just go to our files and click on “New Folder”. The action of creating new directories and moving through different levels can be replaced with the bash command “mkdir” and “cd”.

For example, if we want to create a new directory in our current location, we can do as follow:

mkdir  bashCourse

If we want to enter the directory we just created with mkdir, we can do that with “cd”:

cd bashCourse 

If we want to go back to our previous location, we just need to type “cd ../” where “../” indicates that we want to go back to our previous position (“Go back” arrow in graphical interface).

mkdir  subdir
cd subdir
cd ../

In the example above, we first created a new subdirectory called subdir with “mkdir”, then we entered subdir with “cd” command, and finally went back to our initial position before entering subdir by typing “cd ../”