Essential Unix Commands
The manual for every unix command can be accessed by typing
Redirection is allowed between all commands.
- ls - list files in directory
- 'ls -l' to see file dates and sizes
- 'ls -a' to see invisible files
- cd - change directory
- mkdir - make directory
- rmdir - remove directory
- pwd - show Present Working Directory
- rm - remove a file ('rm -r' to delete a directory tree)
- cp - copy a file
- mv - move a file
- cat - type the contents of a file
- more - page through the contents of a file
e.g. 'ls -al | more' allows you to page through the directory listing
- 'command < file' causes input to the command to come from the file.
- 'command > file' causes the output of the command to go into the file.
- 'command1 | command2' is a pipe, with the output of command1
becoming the input of command2.
Wildcards are also very useful:
The character '*' is as a wildcard for any sequence of characters, including periods or no characters at all.
The character '?' is a wildcard for a single character
e.g. 'cat new*' will type the files 'new', 'news', and 'newspaper',
while 'cat new?' would only type the file 'news'.