[ Quick guide ] How to solve windows pc stuck on recovery screen

Image
Today a friend came to my inbox, their laptop running Windows 10 was stuck on the recovery screen. This is a very common problem with Windows machines. Whenever a computer running Windows OS is not shut down properly, you run the risk of getting stuck in this screen.                                                                                                                                                             (image by: Melissa Lee) Normally, when you get to this screen you just press startup repair and your...

How to change directories in the terminal

Terminal snipets on mac showing command such as tree, mkdir and cd


This post assumes you have basic knowledge of bash and the terminal. If you are not aware of these concepts I suggest visiting these posts

Changing directories in the terminal is simple. Let's start by creating a directory named tutorial.

iterm terminal on a Mac

You will notice we used a default bash command mkdir. This command will create the directory with the name tutorial and we can check that this directory is created by using the ls command.

Iterm terminal on a Mac
We can also make multiple directories in a single line of text at the terminal.
Iterm terminal on Mac

You will notice that we passed the flag -p to the mkdir command. This flag tells Bash to create the directory structure and create any missing parent directories. You can find out more about the mkdir command by typing man mkdir on the terminal.

Again we can use ls to check if the directory is created
Iterm terminal on Mac

You can also see the whole directory structure using the tree command
Iterm terminal on Mac

We can move up multiple directory levels by passing the directory name up to the directory you want
Iterm terminal on Mac
We can use tree again to see exactly where we are in the directory structure
Iterm terminal on Mac

Now let's move to the last directory we created. 
Iterm terminal on Mac


From here, we can move back to the home directory by passing the ../ shorthand to the cd command. This moves you up one directory level at a time.
Iterm terminal on Mac

You will notice that you can move up multiple directories by combining the ../ shorthand.

Conclusion

We can use the cd command to change directories. You can move both up or down a directory structure. We can use the mkdir command to create new directories, the ls command to list directory contents and the tree command to list directories and subdirectories.


Comments

Popular posts from this blog

[ Quick guide ] How to solve windows pc stuck on recovery screen

Opening the Terminal on a Mac