Comparison of common dos and Linux commands
Many Linux commands typed at the shell prompt are similar to those you typed in DOS. In fact, some commands are identical.
This appendix provides common commands for Windows DOS prompts and commands 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 usually have many options. To learn more about each command, read the relevant manual (man) page (for example, enterMan lsYou can read aboutLsCommand Information ).
Command Purpose |
MS-DOS |
Linux |
Simple Linux instance |
Copy a file |
Copy |
CP |
CPThisfile.txt/Home/Thisdirectory |
Transfer File |
Move |
MV |
MVThisfile.txt/Home/Thisdirectory |
List objects |
Dir |
Ls |
Ls |
Clear Screen |
CLS |
Clear |
Clear |
Shell close prompt |
Exit |
Exit |
Exit |
Display or set date |
Date |
Date |
Date |
Delete an object |
Del |
Rm |
RmThisfile.txt |
Echo the output to the screen |
Echo |
Echo |
EchoThis message |
Use a simple text editor to edit files |
Edit |
Gedit([A]) |
GeditThisfile.txt |
Compare file content |
FC |
Diff |
DiffFile1 File2 |
Search for strings in files |
Find |
Grep |
GrepWord or phrase Thisfile.txt |
Format a floppy disk |
Format:(If the floppy disk isA:Medium) |
Mke2fsOrMformat([B]) |
/Sbin/mke2fs/dev/fd0(/Dev/fd0In LinuxA:Equivalent drive) |
Show Command help |
Command/? |
Man([C]) |
ManCommand |
Create directory |
Mkdir |
Mkdir |
MkdirDirectory |
View files |
More |
Less([D]) |
LessThisfile.txt |
Rename a file |
Ren |
MV([E]) |
MVThisfile.txt Thatfile.txt |
Show your location in the file system |
Chdir |
PWD |
PWD |
Use the specified path (Absolute path, absolute path) To change the Directory |
CDPath Name |
CDPath Name |
CD/Directory |
Use oneRelative Path)To change the Directory |
CD .. |
CD .. |
CD .. |
Display time |
Time |
Date |
Date |
Displays the number of memory in use. |
Mem |
Free |
Free |
Note: A. gedit is a graphical text editor, which can be replaced by other text editors.Gedit, IncludingEmacsAndVI. B. This command is used to format a floppy disk in the DOS file system. C. You can also use some commandsInfo. D.MoreThe page splitter can also be used to view objects page by page on a screen. E.MVCommand to 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. Conversion from: Red Hat Linux 9: Red Hat Linux Getting Started Guide |