Open Source

Quick Tip: Learn the Linux versions of common DOS/Windows commands

You probably know the DOS command line inside out. If you're not as familiar with the Linux command line, this article can quickly show you new ways of using old commands.

Most experienced support techs can drop to a command prompt and execute commands and utilities with confidence. However, if you're starting to support Linux desktops on your network, you may quickly find yourself lost when you open a Linux terminal session. Figure A is a list of common DOS/Windows commands that you probably use on a daily basis and their Linux counterparts:
Figure A
What you want to do How you did it in
How you do it in Linux
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
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 -or- scandisk 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
DOS/Windows commands vs. Linux commands

What do you think of this article format?
Our editors are developing new methods and formats for delivering the solutions you need. Do short articles and tables such as this one better help you overcome the IT problems that keep you up at night? Share your thoughts with our editors, and you could win a free TechRepublic book or CD of your choice.

Editor's Picks

Free Newsletters, In your Inbox