Getting comfortable with CMD

Before my data science training, I always felt that Command Prompt or CMD is a tool exclusive to experts. I did not dare to touch it because I might accidentally break my computer. But as I started to write simple commands, I realized that it is not actually scary to use. All I got was an error message whenever I entered an invalid command. Of course, I had to be wary of permanently deleting important files with the rm command but still, being aware of this command is definitely a good progress.
In this blog, I will show you a few simple commands I used with CMD. The commands I will show you are:
- cd
- mkdir
- echo
- dir
- type
- attrib
Let us explore these commands as I tried to create a directory with a read-only .txt file and 3 sub-directories.
I wanted to create the new directory in my Desktop. To change the working directory, use the cd command, which means change directory. Type cd .. command to go back up by 1 directory. Type cd ../.. command to go back up by 2 directories and so on and so forth. Below, I was able to work in my desired directory.

To create a directory, use the mkdir command, which means make directory. This is the same as right clicking the mouse and creating a new folder. Below, I created a Python Projects directory and used it as my working directory.

I then wanted to create a .txt file containing a short description about the newly created directory. To create a file with a text, use the echo command. Below, I echoed the text “Python grps: HW, LEC & PLAY” into the newly created README.txt file.

To look at the files and sub-directories of a directory, use the dir command, which means directory. Below, the only file in my Python Projects directory is the README.txt I created a while ago.

I wanted to display the content of the README.txt file. To do so, use type command. I then wanted to append another line to the file so I again used the echo command. The content of the README.txt file is shown below.

I wanted to add the read-only attribute to the README.txt file. To do so, use attrib command, which means attribute. To display a short summary of any command, execute the command with /?. As shown below, the README.txt file has an archive file attribute. I added the read only file attribute by executing attrib +R README.txt.

Lastly, I wanted to create 3 sub-directories: HW for homework, LEC for lecture and PLAY for playing with the code. Again, I just used the mkdir command to create them.

Finished! Now, I have a directory for my Python Projects that I will create during my data science training in FTW Foundation. This directory seems to be more special than other directories in my computer because I managed to create it by only using CMD for the first time!