Note that these commands usually have a number of options. To learn more about each command, read its associated man page (for example, type man ls at the shell prompt to read about the ls command).
| Command's Purpose | MS-DOS | Linux | Basic Linux Example |
|---|---|---|---|
| Copies files | copy | cp | cp thisfile.txt /home/thisdirectory |
| Moves files | move | mv | mv thisfile.txt /home/thisdirectory |
| Lists files | dir | ls | ls |
| Clears screen | cls | clear | clear |
| Closes shell prompt | exit | exit | exit |
| Displays or sets date | date | date | date |
| Deletes files | del | rm | rm thisfile.txt |
| "Echoes" output to the screen | echo | echo | echo this message |
| Edits files with simple text editor | edit | gedit([a]) | gedit thisfile.txt |
| Compares the contents of files | fc | diff | diff file1 file2 |
| Finds a string of text in a file | find | grep | grep this word or phrase thisfile.txt |
| Formats a diskette | format a: (if diskette is in A:) | mke2fs or mformat([b]) | /sbin/mke2fs /dev/fd0 (/dev/fd0 is the Linux equivalent of A:) |
| Displays command help | command /? | man([c]) | man command |
| Creates a directory | mkdir | mkdir | mkdir directory |
| Views a file | more | less([d]) | less thisfile.txt |
| Renames a file | ren | mv([e]) | mv thisfile.txt thatfile.txt |
| Displays your location in the file system | chdir | pwd | pwd |
| absolute path) | cd pathname | cd pathname | cd /directory/directory |
| Changes directories with a relative path | cd .. | cd .. | cd .. |
| Displays the time | time | date | date |
| Shows amount of RAM in use | mem | free | free |
| Notes: a. Gedit include Emacs and vi. b. This formats a disk for the DOS file system. c. You can also use info for some commands. d. The more e. The mv | |||
Table C-1. Similar Commands
| Главная |