Unix in DOSHere you will get DOS shell (command.com) implementations of some Unix commands. They might be useful to you for one or more of the following reasons.
- If you use Unix more than DOS (or after a heavy session with Unix),
it might happen to you that you
rm -r <dir>at the DOS prompt. command.com then scolds you that you are doing something fishy. Then only you realize that you have to type
rm -r. The batch files provided here sometimes help you in this regard.
- Some DOS commands (once again consider
deltree) do not support multiple parameters, like
del file1 file2 file3 dir1 dir2 dir3The DOS implementation of
rm, allows you to do that, as
rm file1 file2 file3 dir1 dir2 dir3or as
rm -r file1 file2 file3 dir1 dir2 dir3the way you want to delete things.
- These batch files are good examples of how you can write command.com shell programs.
You get here the following batch files. Each of these commands can be
executed with a
-h switch to see what options it supports and
in what format you should specify the command-line parameters.
- Concatenates files. By default, it
sends its output to console. If you want to redirect it to a file, use
-ooption (This is unlike Unix).
- Copies one or many files to a
directory or a file. When it copies multiple files to a file,
it behaves as a concatenation
cp -h to know the details.
- Shows memory usage. Call
df -fto see details on available memory.
- This is not the Unix grep. It can find only strings and not regular expressions. Use the options
-ifor case-insensitive search,
-nfor printing line-numbers of input files where the string apprears and
-vfor displaying lines not containing the search string.
- Listing of files. Options allowed are:
-ashows all files (including hidden ones).
-tshows files sorted according to time (oldest first).
ls.batsupports only one option per call.
- Essentially calls DOS help command.
- Moves single or multiple files to a directory. Type
mv -h to know the details.
- Removes files and/or directories. The
-roption deletes recursively.
- Shows some machine-specific details. This does not work exactly the same way the unix
That's it. Things are certainly not serious. It's the result of a little hacking in a free evening. It's my pleasure if you like it. And, of course, you may download all these programs.
Have a nice time......
Abhijit Das (Barda)
Department of Computer Science and Automation
Indian Institute of Science
Bangalore 560 012
This page hosted by Get your own Free Home Page