Linux commands - some basics
Archive - Originally posted on "The Horse's Mouth" - 2005-08-31 07:54:51 - Graham EllisDos command | Linux command | Description | ||
---|---|---|---|---|
File basics | ||||
copy | cp | CoPy file(s) | ||
ren | mv | MoVe (rename) file(s) | ||
del | rm | ReMove (delete) file(s) | ||
dir | ls | List files / Symbols | ||
Working on file contents | ||||
- | file | What's in a file? | ||
type | cat | Display file contents | ||
| more | more | display file page by page | ||
- | head, tail | Display start, end of file | ||
- | diff | Report differences between files | ||
edit | vi guidelet | Edit a file | ||
Directory handling and navigation | ||||
cd (no params) | pwd | Present Working Directory (where am I?) | ||
cd (with params) | cd | Change Directory | ||
md | mkdir | MaKe DIRectory | ||
rmdir | rmdir or rm -r | ReMove DIRectory |
If you're familiar with the Windows / MSDos command line any your're moving across to / occasionally using Linux, the table above may help you.
On both DOS and Linux, you start your command line with the name of the command and then provide any parameters you need, space separated thereafter. Options to DOS commands are specified with switches of the form /x which are placed at the end of the command, whereas with Linux options are specified after the command name, and preceeded with a - sign.
Example:
dir *.*/w ... on MsDos
ls -l * ... on Linux