When learning a new operating system things can be quite daunting, for those people who have come to UNIX from a Microsoft background you will find quite a few similarities between the way UNIX and DOS behave, in reality DOS is very similar to UNIX as it is loosely based on it. If you are interested UNIX stands for UNiplexed Information and Computing, this catchy acronym and indeed the Operating system were dreamt up in 1969 by a team at Bell Labs consisting of Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna, more information here.
Below you will find a list of UNIX commands with their DOS equivalents, this page will also explain how Shell Commands can interact making them even more powerful and useful.
Action
|
DOS
|
UNIX
|
change directory |
cd |
cd |
change file protection |
attrib |
chmod |
compare files |
comp |
diff |
copy file |
copy |
cp |
delete file |
del |
rm |
delete directory |
rd |
rmdir |
directory list |
dir |
ls |
edit a file |
edit |
vi/pico |
environment |
set |
printenv |
find string in file |
find |
grep |
help |
help |
man |
make directory |
md |
mkdir |
move file |
move |
mv |
rename file |
ren |
mv |
show date and time |
date, time |
date |
show disk space |
chkdsk |
df |
show file |
type |
cat |
show file by screens |
type filename | more |
more |
sort data |
sort |
sort |
man {command}
|
Type man ls to read the manual for the ls command. |
man {command} > {filename}
|
Redirect help to a file to download. |
whatis {command}
|
Give short description of command. |
apropos {keyword}
|
Search for all UNIX commands that match keyword, eg apropos file. |
ls {path}
|
It's ok to combine attributes, eg ls -laF gets a long listing of all files with types. |
ls {path_1} {path_2}
|
List both {path_1} and {path_2}.
|
ls -l {path}
|
Long listing, with date, size and permisions. |
ls -a {path}
|
Show all files, including important .dot files that don't otherwise show. |
ls -F {path}
|
Show type of each file. "/" = directory, "*" = executable. |
ls -R {path}
|
Recursive listing, with all subdirs. |
ls {path} > {filename}
|
Redirect directory to a file. |
ls {path} | more
|
Show listing one screen at a time. |
dir {path}
|
Useful alias for DOS people, or use with ncftp. |
cd {dirname}
|
There must be a space between. |
cd ~ |
Go back to home directory, useful if you're lost. |
cd .. |
Go back one directory. |
cdup |
Useful alias, like "cd ..", or use with ncftp. |
mkdir {dir name}
|
e.g. mkdir test |
rmdir {dirname}
|
Only works if {dirname} is empty.
|
rm -r {dirname}
|
Remove all files and subdirs. Careful! |
pwd |
Show where you are as full path. Useful if you're lost or exploring. |
cp {file1} {file2}
|
|
cp -r {dir1} {dir2}
|
Recursive, copy directory and all subdirs. |
cat {newfile} >> {oldfile}
|
Append newfile to end of oldfile. |
mv {oldfile} {newfile}
|
Moving a file and renaming it are the same thing. |
mv {oldname} {newname}
|
|
rm {filespec}
|
? and * wildcards work like DOS should. "?" is any character; "*" is any string of characters. |
ls {filespec}
|
Good strategy: first list a group to make sure it's what's you think... |
rm {filespec}
|
Good strategy: first list a group to make sure it's what's you think... |
more {filename}
|
View file one screen at a time. |
less {filename}
|
Like more, with extra features. |
cat {filename}
|
View file, but it scrolls. |
cat {filename} | more
|
View file one screen at a time. |
page {filename}
|
Very handy with ncftp. |
vi {filename}
|
Use text editor and don't save. |