How to use the command line
To use the command line, enter a valid command line command along with any additional parameters. The command line then executes the command as you entered it and performs the task or function that it is intended to perform on Windows.
For example, executing the following command line command in the Downloads folder will delete all MP3 files in that folder:
del * .mp3
Commands must be entered on the command line accurately. Incorrect syntax or misspelling can cause a command to fail or deteriorate; it can execute the wrong command or the right command in the wrong way. A level of comfort with read command syntax is recommended .
For example, running the command dir will show a list of files and folders that exist in any particular location on the computer, but it doesn’t actually do anything . However, change just a couple of letters, and it turns into the del command , which allows you to delete files from the command line!
The syntax is so important that for some commands, especially the delete command, adding even a single space can mean deleting completely different data.
Here’s an example where a space in the command splits the line into two sections, essentially creating two commands that delete files in the root folder (files) instead of files in a subfolder (music)
del C: \ files \ music
The correct way to run this command to delete the files in the music folder instead is to remove the space bar so that the entire command is properly joined.
Don’t let this discourage you from using command line commands, but definitely do it with caution.
Command Line Commands
There are a large number of commands on the command line , but their availability depends on the operating system. You can see which command line commands are compatible with your particular operating system.
Here are some of the most commonly used command line commands that are used in various situations: chkdsk , copy , ftp , del , format , ping , attrib , net , dir , help and shutdown.