About a month ago I wrote an article about why the command line was still useful. This morning I ran into a problem that once again proved the command line’s worth to me.
I was trying to delete an old website backup that was in the .zip format. When I tried to delete it, Windows gave me an error saying that the file could not be deleted because it was already in use. Since it was a zip file, there was no way it could be in use unless it was actually open. The file was not running so I couldn’t figure out why Windows wouldn’t allow me to delete it. I still don’t know why I was getting the error message but I was able to delete the file using the command line.
Go to Start > Programs > Accessories > Command Prompt. Navigate to the directory where the files is located using the cd command. When I open the command prompt it is already in the directory C:\Documents and Settings\myusername\. My file was two levels deeper so I did the following:
cd My Documents\kimwoodbridge
All I had to do now was type the delete command followed by the name of the file:
Presto!! The file was gone.
The delete command can also be used to quickly delete the entire contents of a directory using wildcards. If I wanted to delete everything in the kimwoodbridge directory, I would navigate to that directory using the cd command and then type:
This is telling the system to delete every filename with every type of file extension.
Do you ever use the command line? If so, what is your most common use? If not, do you not use it because you don’t need to or because you have never used it before?
photo credit: aldoaldoz