[Linux] Comparison of common DOS and Linux commands

Source: Internet
Author: User
Tags clear screen diff

Many of the Linux commands you type at the shell prompt are similar to the commands you type under DOS. In fact, some commands are exactly the same.

This appendix provides common commands for Windows with DOS prompts and commands that are equivalent to them in Linux. The appendix also provides a simple example of how to use these commands at the Linux shell prompt. Note that these commands often have many options, and to learn more about each command, read the relevant manual (man) page (for example, type man ls at the shell prompt to read information about the ls command).

purpose of the order MS-DOS Linux A simple example of Linux
Copying files Copy Cp CP thisfile.txt /home/thisdirectory
Transferring files Move Mv MV thisfile.txt /home/thisdirectory
Enumerating files Dir Ls Ls
Clear Screen Cls Clear Clear
Turn off shell hints Exit Exit Exit
Show or set date Date Date Date
deleting files Del Rm RM Thisfile.txt
"echo" the output to the screen. Echo Echo echo this message
To edit a file with a simple text editor Edit gedit ([a]) Gedit thisfile.txt
Compare file Contents Fc Diff Diff File1 file2
Find a string in a file Find Grep grep Word or phrase Thisfile.txt
Format floppy disk format A:(if the floppy disk is in a: ) mke2fs or mformat([b]) /sbin/mke2fs/dev/fd0(/dev/fd0 is Linux with a: equivalent drive)
Show Command Help command /? Man ([C]) Man Command
Create a Directory Mkdir Mkdir mkdir Directory
View Files More Less ([d]) Less thisfile.txt
Renaming files ren MV([E]) MV thisfile.txt thatfile.txt
Show your location in the file system ChDir Pwd Pwd
Use the specified path ( absolute path, absolutepath) to change the directory CD path name CD path name CD /directory/directory
Use a relative path (relative path) to change the directory Cd.. Cd.. Cd..
Show time Time Date Date
Shows the amount of memory that has been used Mem Free Free
Note:
A. Gedit is a graphical text editor, and you can use other text editors instead of Gedit, including Emacs and VI.
B. This command formats the floppy disk for the DOS file system.
C. You can also use infofor some commands.
D. The more paging device can also be used one screen at a screen to view pages in a file.
The E. mv command can transfer files or rename files in the same directory. If you want to rename the file, as shown in the example, "transfer" the file to a new name in the same directory.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.