Here are some of our favorite Unix commands (and hopefully an explanation of what they do):
If it's not listed here, try Unix Station or our Our Local Unix Help among others . . .
- ls -- lists the contents of a directory (a.k.a "folder"); using optional switches makes it do more fun stuff. For example, "ls -l" lists files with ownership information, permissions, and last modified date. For more info from unix itself type "man ls" (at a unix box). By the way, you can also do "ls" in Windows these days, from a command prompt, if you don't want to do the "dir" command.
- cd <Directoryname> -- moves from one directory to another.
- cd ../ -- moves up one directory from where you are.
- cd - -- moves you back to the last directory you were in.
- mkdir <Directoryname> -- creates a new directory. It is recommended that directory names begin with an upper case letter and file names are in all lower case, but that is just a recommendation and not a rule.
- mv <filename> <path> -- moves a file from the current directory to the one specified.
- mv <filename> <newfilename> -- renames a file.
- cp <filename> <newfilename> -- copies a file and keeps the original one. Do this before you edit an existing file.
- cp -p <filename> <directory> -- copies an executable file to another directory and keeps the permissions.
- clear -- clears the page of text and puts the prompt at the top of the page.
- lp <filename> -- prints file to default system printer.
- h -- gets a list of the last few commands issued.
- h and a number -- gives the history from that prompt number on.
