Crucial things you should know about using a command line

If you have already started using a command line of your operating system or you are looking for the ways you can utilise it, this article will provide you with some useful information on the topic.

Be specific while using a command line

The Windows operating system by default do not show the file extensions while the macOS and Linux do. You can change this behaviour by going to the explorer and view.

Remember how specific you have to be when you are working with the command line. So, not only the filename extension, you have to specify the proper directory where this file resides.

Mounting

Windows assigns drive letters to each of the hard drive partition in use but same is not true for macOS and Linux. For these latter ones, the boot partition is defined as the root drive, indicated with a forward slash and dot ‘/.’  and any other subsequent storage partitions must go through the process of mounting. This process lets the operating system treat this partitions as folders. All of these folders are then mounted to a single folder, called /mount or /media in Linux and /Volume in macOS.

Hierarchical directory tree

No matter which operating system you are using, all of them use the same structure for folder organisation called hierarchical directory tree.  All of the files and content are put together inside a folder which is also commonly refer to as a directory. Remember that whichever file or folder is in the last directory, that is the root directory.

For Windows, letter, colon and a backward slash defines the directory. For instance, the root directory of Windows will be represented like this – C:\.

Getting to a specific file through a command line

To get to specific folder under this root directory, simply type in the name of the folder and hit enter. All other sub folders will be divided by a backward slash to indicate the point of entry. Something like – C:\users\mojoJojo.

Now if you want to get access to a specific file and you know which file it is, simply type in the name of the file with the extension of course.

For instance, C:\users\mojoJojo\myVdos\nature.mp4. This will play the file for you .

The exact location for these files are called path. So the path for this nature.mp4 will be C:\users\mojoJojo.

Using a path on macOS and Linux

For macOS and Linux, both of them use the same path convention. Remember that folder names are separated by a forward slash, rather than a backslash. About folder and file naming convention, both Windows and macOS are not case sensitive but same not true for Linux. Linux will treat ‘folder’ and a ‘Folder’ as two different folders.

Remember that both macOS and Linux show your home folder with a tilde (~) rather than the folder name along with the current username. Do not worry if you feel lost here, simply type in pwd and it will show you the exact folder you are in.