How To >> Browse Articles >> Linux / Unix
A Few DOS to Linux Commands
October 13, 2007
When you’re getting started with the Linux command line, it helps to be able to translate some commands you know into the ones you’re trying to learn. If you’re coming from a Windows or DOS environment, here’s how you’ll accomplish some common tasks using the Linux command line.
| Action | DOS Command | Linux Command |
| Copy a file | copy path1\filename1 path2\filename2 | cp path1/filename1 path2/filename2 |
| Copy subdirectory | xcopy path1\. path2 /s | cp -R path1 path2 |
| Delete a file | del filename | rm filename |
| Move a file | move path1\filename1 path2 | mv path1/filename1 path2 |
| Rename a file | ren filename1 filename2 | mv filename1 filename2 |
| List a directory | dir | ls |
| Change directory | cd \path | cd /path |
| Make directory | md path | md path |
| Delete a subdirectory | deltree \path1 | rm -R path |
| List text file contents | type filename | cat filename |
| Edit a file | edit filename | pico filename |
| Format floppy | format a: | fdformat /fd0H1440 |
| Check for disk errors | chkdsk drive |
fsck /device |
| Change file attribute | attrib +- attribute filename | chmod mode filename |
| Clear screen | cls | clear |
| Display environment variables | set | env |
| Set environment variable | set variable=value | env variable=value |
| Set time | time time | date MMDDHHSS |
| Close command prompt | exit | exit |
akki_kamiwaga
about 1 month ago
2 comments
okay i am new to all this.. i have wanted to learn how to operate linux, but in order to that i need some help.. anyway feel free to help out a newbie. . . i have googletalk to instant message..please i beg for help.
angelahadtwins
10 months ago
24 comments
I like this! I love to see the comparison code between operating systems. I am still learning how to use them. Thanks! :)
jamesspeer
about 1 year ago
10 comments
nice basic list..
1 more i would like to see is searching a directory(s) for a certain file or directory useing a wildcard. I beleive in DOS it is dir /s whatever*.* and in linux it is find whatever*.* nice list though for a newb switching to linux from windows
mrc
about 1 year ago
2 comments
Excellent!
rmelendez3
about 1 year ago
44 comments
Not bad it's pretty nice to see the difference in commands between dos and linux.
kmart
over 2 years ago
46 comments
Ok...The formatting seems to have gotten lost in translation.