Ravinder Singh

Male
Friday, February 24, 1984
I am a software engineer by profession and programmer by passion. I love working on software projects which help make a positive impact on the society.

How to use windows command prompt - Part 2

Category: Windows Command Prompt Tutorials Date: Thursday, June 23, 2016

Now that you have started getting familiar with the windows command prompt and know how to run some of the basic commands, let's move ahead and learn some more commands which you can execute using the windows command prompt. In this article you will learn about 2 very important commands which will help you find files and folders in your computer. The two commands you will be learning are

  1. Cd - Change directory command
  2. Dir - Command to see the list of all folders and files in the current directory.

To understand both these commands let's take a couple of steps back and understand a few important concepts. When you open the command prompt on your computer, this is what you see on your command prompt screen.

Image

There is a cursor blinking on your screen and to the left of it it’s written

C : \ windows \ system32 >

This is the path of the current working directory to which your command prompt is pointing to. The command prompt opens and shows this path by default because this is the folder in which the command prompt application is stored. 

CD command

In order to make the best use of the command prompt, you will have to learn how to navigate to different folders in your computer. For this purpose you will have to use the cd command, which stands for change directory. Using the cd command is very simple, all you have to do is type cd followed by the full path of the folder to which you want to open. For example, I have a folder named temp in my c drive. So if I want command prompt to open this folder, I will have to type

cd c:\temp

In the animated image below, notice how I am changing the folder location to the c:\temp folder by executing the cd command

Image

In the similar manner you can open any folder on your computer by using the cd command. Look at the command below

cd d:\Songs\English

By executing the above command I am asking the command prompt to open the English folder stored inside the Songs folder in the d: drive of my computer. You should try opening different folders on your computer by making use of the cd command so that you can understand the usage of this command better.

Note : There are many more ways to use the cd command, you have just learnt a very simple way so that you can understand the usage of this command. For now, please keep in mind that when you try to open a folder on your computer there should be no space in the name of that folder. I will explain more about such concepts in the coming tutorials.

Dir command

Now that you know how to open any folder on your computer, you should learn how to see the contents of the folder you are opening. For example, if you open a folder which contains your project related documents, then you will want to see which all files are present in your folder. For this purpose you will have to use the dir command. Using the dir command is very simple, you just have to type dir and press enter. It will show you the list of all the files and folders present in the current working folder which you have opened using the command prompt. Look at the animated image below

Image

In the above image notice that initially the command prompt was pointing to c:\windows\system32 folder. I am first changing the current folder to c:\songs folder by using the cd command and then displaying the list of files and folders inside the c:\songs folder by using the dir command. In the image above you can notice that there are three folders English, Hindi and Punjabi inside the songs folder. The word <div> written in front of any name in the list tells that the item being displayed is a folder (directory).

In the next tutorial we will be covering both the cd and dir commands in more depth.

Rate this article and help us improve

Please Login to rate
Overall ratings: 0 | Rating: out of 5
Previous Article Next Article

Quick Links

E-Magazines

@

Total Followers
Study Group Created
Study Group Joined
Following Teacher
Following Organization
Blog Articles Added
Questions Asked
Questions Answered
Jobs Posted
Total Members in Group
Questions asked by members
Tasks added in this Group

Please wait..

Ok

Login to Open ESchool OR Create your account    Login   SignUp