Many Linux commands typed at a shell prompt are similar to the commands you would type in MS-DOS. In fact, some commands are identical.
| Note | This chapter provides common commands used at the MS-DOS prompt in Windows and their counterparts in Linux. Basic examples of how the commands are used at the Linux shell prompt are also provided. 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). Table 24-1: A Comparison of MS-DOS and Linux Commands Command's Purpose | MS-DOS | Linux | Linux Example | Copies files | copy | Cp | cp thisfile.txt /home/directory | Moves files | move | Mv | mv thisfile.txt /home/directory | Lists files | dir | ls | ls | Clears screen | cls | clear | clear | Closes prompt window | exit | exit | exit | Displays or sets date | date | date | date | Deletes files | del | rm | rm file.txt | "Echoes" output on the screen | echo | echo | echo message | Edits files with simple text editor | edit | pico | pico file.txt | Compares the contents of files | fc | diff | diff file1 file2 | Finds a string of text in a file | find | grep | grep word_or_phrase file.txt | Formats a diskette | format a: (if diskette is in A:) | mke2fs or mformat | /sbin/mke2fs /dev/fd0 (/dev/fd0 is the Linux equivalent of A:) | Displays command help | command /? | man | man command | Creates a directory | mkdir | mkdir | mkdir directory | View a file | more | less | less file.txt | Renames a file | ren | mv | mv this_file.txt that_file.txt | Displays your location in the file system | chdir | pwd | pwd | Changes directories with a specified path (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 and use | mem | free | free | |