DOS Command |
Linux Equivalent |
Description |
dir dir *.txt |
ls ls *.txt |
Lists files in the current directory. Lists the text files in the current directory. |
cd dirname cd\ cd.. --- |
cd dirname cd / cd .. cd |
Changes the directory. Changes to the root directory. Go up one directory. Go to user's home directory. |
del filename | rm filename | Deletes a file. |
deltree dirname --- |
rm -r dirname rm -rf dirname |
Deletes a directory and all of its contents. Delete a directory and all of its contents without any confirmation. |
md dirname --- |
mkdir [-p] dirname mkdir -p dirname1/dirname2 |
Creates a directory. Creates a directory structure. |
--- | touch filename touch filename1 filename2 |
Creates a new file or updates a file's date stamp. |
move filename dest | mv filename dest | Moves files to a destination directory. |
ren oldname newname | mv oldname newname | Renames a file. |
copy originalfile clonefile | cp originalfile clonefile | Copies a file. |
xcopy source dest xcopy32 source dest |
cp -a source dest | Copies directories or files, maintaining the directory structure. |
cls | clear | Clears the screen and sets the prompt to the top of the screen. |
type filename | cat filename | Displays the contents of filename. |
--- | wc -l filename wc -w filename wc -c filename |
Counts the number of lines contained in filename. Counts the number of words contained in filename. Counts the number of characters contained in filename. |
--- | command1 | command2 | Pipes output of command1 to command2 to serve as command2's input. (i.e. cat filename | wc -l, which counts the lines in filename). |
command > filename --- --- |
command >filename command 1>filename command 2>/dev/null |
Redirects output of command to a new file. Redirects output of command to a new file. Redirects error messages of command to /dev/null. |
--- | chown -R user:group filename dirname | Changes ownership of files and/or directories and their contents. |
--- | chgrp -R group filename dirname | Changes ownership of files and/or directories and their contents. |