Moving Between drives with CLI on Windows

Command line works almost in an identical way for both Windows and UNIX-based operating systems. That is in terms of their structure of running a command. Their approach to various parts of functionality may differ a lot! Moving between these two operating systems differ from each other. This is because, Windows assigns its drivers letters while macOS, Linux do not. Starting here with straight off with UNIX would not be a good idea, so let’s start with Windows and see how it works on Windows and we will see the UNIXes.

Switching between directories on Windows

A lot of beginners make a mistake with the cd command as the go to command to move between drivers. Unfortunately, that is not the case. Yet, this is nothing difficult to do so, nor it is some impossible to remember name of a command. To move between drivers, you just simply type the drive letter followed by a colon. Let’s say you are in drive D and you want to move to drive F. So, you would simply type f: and hit enter. This will switch the drive.

D:\myMusic\iron maiden > e: E:\ >

This is thus easy. You want to go back to D?

Type d:, hit enter and you are back to drive d. The best thing is that you will get back to the same place where you left it. So, in our case, we will land in the mighty Iron Maiden folder.

Learning from error messages

When you are using the command line tool, many times you will face error messages. This may lead to hectic frustration. Yet, let me give you food for thought about these error messages that may help you to get yourself very well adjusted to such error messages.

Imagine, that you are trying to execute a command but no matter what you do, nothing is happening or behaving strangely and in a way different from the authentic behaviour. How will you know what is going wrong?

Yes, here the error messages comes in so handy. They are in a sense a life and time saviour because they immediately prompt you with the relevant error message. Hence, rather than scratching your head, you can immediately take action based on the error message.

Try this. Make deliberate error with any command you learn. For instance, we have just learned to navigate between drives. Try switching to a drive that you know does not exist. I know I do not have a ‘z’ drive. If I try to switch to z:, I will get this error message – “The system cannot find the drive specified”. Along with this technique, remember to use combo, which you will a lot in the world of tech, the cd and dir command. cd command is used to change directory or folder and dir command is used to view the list of contents inside the directory. Getting comfortable with these commands allows you to explore any possible place inside the system.

Switching between directories on other popular systems

Now let’s look at the UNIX based system like macOS and Linux. When you are coming from Windows and trying to navigate your way around the drives, it is a whole new scenario here. You will find that these operating systems do not have drive letters.

Naturally you will wonder how you can go around the drive then. Well, the thing is for these operating system, it works as all media is mounted as folder. Also, take a note that the location of such mounted folders will vary based on operating systems.

On macOS, you want to look for the /Volume folder. For Linux Ubuntu, you want to look for the /mnt folder for drives and /media/ <user name> folder for any removable media like a thumb drive, optical disc etc. For any other Linux distribution, you need to explore them. Consider using the cd and ls command. It will help you a lot to find the drives you are looking for.

If you are new in the world of tech, be as a software engineer, IT guy, geeky tech, nerd, computer science genius, you will need to invariably use the command line to get lot of things done and for automation. There are even cases when you do not have a choice to work with the GUI (Graphical User Interface) at all. For instance, if you have to work in the backend, with the server side, you do not have a choice but to live and breathe command line. Getting these very basic commands can help you a lot in the long run since not only does it show your proficiency of computer literacy but also shows how cool of tech you are, working inside out of a system.