This month
we finish up the command prompt tutorial and you’ll be ready to deal
with the non-Windows interface.Hey, this is a dense subject and
the command prompt confused millions of computer users for many,
many years so keep your chin up if you don’t get it the first dozen
times. Review the previous articles in this series (both
1
and
2) and hang in.
A Word of Caution
The last command we’ll take up is the delete command. The command
line delete command comes in handy as often Windows will be using a
file and won’t allow you to delete it. For instance the cookies
index file is always "busy" in Windows and won’t allow you to delete
it. However it’s never used in plain old DOS and it’ll allow you to
delete away.
A word of caution: files deleted at the command prompt aren’t
sent to the recycle bin. There are utilities that allow you to
recover them but they assume that nothing has overwritten the space
that the file once occupied. I think the
Recover product is about as there is in this area and it’s worth
checking out, especially the free evaluation version, but remember,
there’s no guarantee that any tool will get your file back.
Del or Delete. It’s All the Same
The delete command is the word DELETE or the shorter version DEL.
Either works just fine. Thus:
del myfile.ext
and
delete myfile.ext
do exactly the same thing. Remember that any command must be
followed by the enter key to actually execute it and send the file
into the bit bucket.
Using It
From the previous articles you’ll recall that the command prompt
doesn’t function perfectly with the long file names often found in
Windows so be sure and use the DIR command we covered previous to
identify the exact file you want to take out. I think it’s best to
use the exact filename, even if it’s a long filename:
del "my report on the stock market.doc"
but you can use the short filename, both work just fine.
Wild and Crazy Guy
The last aspect of the command prompt is probably the most
powerful and that’s the wildcard feature, which allows you to do
some very serious damage. A wildcard is a special character that
covers a whole boatload of files.
For instance:
dir *.doc
shows all files with an extension of .doc, regardless of the
actual filename.
dir myfile.*
shows you all files named myfile regardless of the extension.
The wildcard feature can be used in conjunction with any of the
file related commands (dir, copy, delete) to eliminate typing. For
instance.
copy *.* c:\target
will copy all the files in the current directory to c:\target.
Similarly:
del *.*
will delete all the files in the current directory. Ouch!
But it can be handy. There may be cases where you want to delete
everything in a folder. Just be sure that you know the results of
your actions before you execute them.
Be Careful Out There
So be careful but don’t be put off by the command prompt. Of all
the things I've taught about computers the command prompt remains
the hardest to explain and the most cryptic but it allows you a level of control that you’ll
never get in Windows. Most likely I've not touched on the specific
thing you need to do and, if so, please feel free to drop by the
message area and I'll be glad
to provide the syntax for a specific situation.
Finally I've not gone over the command line RENAME command. It can use
wildcards just as the COPY or DEL command but generally I've found
that the RenameMan
program is easier to use and does a better job.
Until next time, best in computing.