Basic CMD Command Lines | MS-DOS Commands

CMD stands for โ€œCommandโ€ but in Windows, it is known as Command Prompt. It is a Command-Line Interpreter which is provided by the Microsoft in Windows OS. This command prompt is used to execute the entered commands in the command shell to perform some advanced administrative functions like you can manage your file properties, system properties, user manager, etc. by using command lines So, letโ€™s see what are the basic commands lines that can help you to interact with your operating system(window).

Basic CMD Commands Line

1) systeminfo

โ€œsysteminfoโ€ is a system information command that helps to show all the information of your system in the terminal. So letโ€™s run this command in the terminal and see what itโ€™ll give usโ€ฆ

As you can see in the given image its shows all the information about my system.

2) date /t

โ€œdate /tโ€ is a command that helps you to show the current date. So, letโ€™s try this command in the terminalโ€ฆ

As you can see the date when I was using this command in my system.

3) time /t

Itโ€™s exactly the same command as โ€œdate /tโ€ command. This command helps you to show the current time of your system. So, letโ€™s try this command in the terminalโ€ฆ

As you can see the current time when I was using the system.

4) ver

โ€œverโ€ is a version command line that helps you to show your current version of your system.

As you can see my current version of my system is Windows version 10.0.22000.194.

5) dir

โ€œdirโ€ is a directory command that helps you to display all the files and folders from your current directory. As you can see in the above image my current directory is C:\Users\ankus. So, letโ€™s try this command to check how many files and folder are there in my current directory (C:\Users\ankus).

As you can see in my current directory (C:\Users\ankus) there are only one file have (CMD Command Line.txt) and 12 folders(Contacts, Desktop, Documents, Downloads, Favourites, Links, Music, OneDrive, Pictures, Saved Games, Searches and Videos)

6) cd

โ€œcdโ€ is change directory command. It helps you to change your current directory to another directory. As you can see in the โ€œdirโ€ command image there are 12 folders that have. So, letโ€™s try to move into the folder โ€œDownloadsโ€.

To move to the Downloads directory so we have to write โ€œcd Downloadsโ€ in the terminal. letโ€™s seeโ€ฆ

As you can see we have successfully changed our directory from (C:\Users\ankus) to (C:\Users\ankus\Downloads).

7) mkdir

โ€œmkdirโ€ is a command that helps you to create a new directory/folder in your system. So, letโ€™s try this command.

Before trying this command first letโ€™s check how many folders are there in our current directory. letโ€™s checkโ€ฆ

In our current directory there are two folders (files and program). So, now letโ€™s create a new directory/folder with the name of โ€œcomputerstudypointโ€ by using mkdir command.

To create computerstudypoint directory/folder we have to write โ€œmkdir computerstudypointโ€ command in the terminal. letโ€™s try it..

As you can see the computerstudypoint directory has been created.

8) rmdir

โ€œrmdirโ€ is a remove directory command that is used to remove/delete the directory. Well we recently created a computertstudypoint directory with the help of โ€œmkdirโ€ command. So now letโ€™s try to remove this directory with the help of this command. Letโ€™s remove itโ€ฆ

To remove a computerstudypoint directory so we have to write โ€œrmdir computerstudypointโ€ command in the terminal. letโ€™s seeโ€ฆ

As you can see the computerstudypoint directory has been removed.

9) Creating file commands

As such, there is three-way to create a new file.

i. By using โ€œtypeโ€ Command

Well, the โ€œtypeโ€ command is used to display the content of the text file in the terminal. But it is also used for creating empty files. The command for creating files is โ€œtype nul > yourfilename.txtโ€. let our file name be CSpoint.txt. letโ€™s try to create it in the terminalโ€ฆ

As you can see the โ€œCSpoint.txtโ€ file has been created.

ii. By using โ€œechoโ€ command

The โ€œechoโ€ command is used to create a non-empty file.

To use this command we have to write โ€œecho some textcontent yourfilename.txtโ€. Let our text content is โ€œHello guys welcome to computertstudypointโ€ and our filename is โ€œCMD.txtโ€

Letโ€™s try it outโ€ฆ

As you can see the โ€œCMD.txtโ€ file has been created with some content โ€œhey guys welcome to computerstudypointโ€.

iii. By using โ€œnotepadโ€ command

โ€œnotpadโ€ is the easy way to create a new file. To use this command we have to write โ€œnotepad yourfilname.txtโ€. Let our new file name be โ€œprompt.txtโ€. letโ€™s try to create new file in the terminalโ€ฆ

As you can see the โ€œprompt.txtโ€ has been created. And, the left side of prompt.txt has 0 which means this file is totally empty there has no data or 0 data.

10) del

โ€œdelโ€ delete command that helps to delete all the files of our system. letโ€™s remove some files like I am going to remove all those these files which I recently created (CMD.txt, CSpoint.txt, and prompt.txt), To delete these three files so we have to write โ€œdel CMD.txt CSpoint.txt peompt.txtโ€ in the terminal. letโ€™s try this commandโ€ฆ

To dele

As you can see the three files which I created recently have been deleted.

11) cls

โ€œclsโ€ is a clear command that is used to clear all the text of the terminal.

As you can the โ€œclsโ€ command has cleaned our terminal.

11) exit

The โ€œexitโ€ command is used to exit the terminal window. I donโ€™t think I should show you this command in the terminal๐Ÿ˜….

Leave a Comment

Top 7 Artificial Intelligence Courses for 2024 Top 10 Best Cybersecurity Courses for computer enthusiast Top 8 Btech colleges in Mumbai for 2024 Top 9 Best Mtech colleges in Bangalore for 2024 7 Best High paying Cyber Security Jobs in India
Top 7 Artificial Intelligence Courses for 2024 Top 10 Best Cybersecurity Courses for computer enthusiast Top 8 Btech colleges in Mumbai for 2024 Top 9 Best Mtech colleges in Bangalore for 2024