The DOS (Disk Operating System) and Unix environment are looking same in appearance but there are many differences, here are the few.
such as to list the directories and sub directories and hidden directories available in a drive we use ls -lRa in UNIX and we use dir/p/od in DOS environment .
such as to list the directories and sub directories and hidden directories available in a drive we use ls -lRa in UNIX and we use dir/p/od in DOS environment .
Function
|
DOS (5 or greater)
|
Unix (BSD 4.3 & System V.3)
|
Directory listing: names only
|
dir /w
|
ls
ls -a ("a" for all, including hidden files) |
Directory listing: names, sizes, dates
|
dir
|
ls -al ("l" for long)
ls -a -l |
Ditto, sorted by date of file
|
dir /od
|
ls -alt ("t" for time)
|
Ditto, pausing between screens
|
dir /p /od
dir /od | more |
ls -alt | more (BSD)
ls -alt | pg (V.3) |
Display contents of a file
|
type file
|
cat file
|
Ditto, pausing between screens
|
more < file
|
more file (BSD)
pg file (V.3) |
Edit a file in full-screen mode
|
edit file
|
vi file (#1 editor)
|
Create a directory
|
mkdir dir
md dir |
mkdir dir
|
Change current directory
|
cd dir
cd dir\sub |
cd dir
cd dir/sub |
Change to parent directory
|
cd ..
cd.. |
cd ..
|
Change to root directory
|
cd \
cd\ |
cd /
|
Change to HOME directory
(where you start when you login) |
(NOT APPLICABLE)
|
cd
cd /u/userid (Some systems instead use: "cd /home/userid") |
Display name of current directory
|
cd
|
pwd
|
Display directory, and subdirectories
|
dir /s
tree /f |
ls -R
find . -print |
Ditto, but not the files
|
tree
|
find . -type d -print
|
Erase a file
|
erase file
del file |
rm file
|
Erase an empty directory
|
rmdir dir
|
rmdir dir
|
Erase a directory, files and subdirs.
|
erase dir/*.*
erase dir/sub/*.* |
rm -fr dir ("r" for recursive, “f” for force)
|
Make a copy of a file with new name
|
copy file newfile
|
cp file newfile
|
Copy a directory & subdirectories
|
xcopy dir newdir /s
|
cp -r dir newdir
|
Move a directory to another directory
|
1ST: xcopy dir newdir /s
2ND: (Erase dir as above) or use move on DOS6+ |
mv -r dir newdir
|
Rename a file
|
rename file newname
|
mv file newname
|
Rename a directory
|
mv dir newname
|