--------------------------------------------------------------------------- A Summary of Basic UNIX Commands --------------------------------------------------------------------------- How to use this summary: 1. Substitute your file/directory names for file1, file2, directory, etc. 2. Repeatable arguments are followed by ellispes (...). 3. Arguments in brackets [ ] are optional. Do not type the brackets. --------------------------------------------------------------------------- Starting up --------------------------------------------------------------------------- login sign on the system passwd change login passwd logout sign off system --------------------------------------------------------------------------- Manipulating files and directories --------------------------------------------------------------------------- cat [-n, -v] [file] concatenate and print Options: -n numbers lines -v prints invisible characters cd [directory] change directory (to home directory if none is specified) cp file1 file2 copy file1 to file2 (file1 still remains) cp file1 [file2...] directory make a copy of file1 [file2...] in directory lpr [file...] send file to the printer lpq check the printer queue lprm [file...] remove file from the printer queue ls [-a, -l, -F, -R] [file..., directory...] list files in current directory (or just the named files, directories) Options: -a list all files, including hidden files -l list in long format -F mark directories with `/' and executable programs with `*' -R list recursively any subdirectories mkdir directoryname create a new directory more [file...] view file on terminal, one screen at a time press space bar for next screen, q to quit mv file1 file12 rename file1 as file2 mv file... directory move file... to directory mv directory1 directory2 move directory1 into directory2 rm file... remove file... rmdir directory remove directory (which must be empty) --------------------------------------------------------------------------- Redirection operators --------------------------------------------------------------------------- command > file direct output of command to file (file will be created if necessary) command >> file append output of command to file command < file read from file for the input into command command1 | command2 send output of command1 as input to command2 --------------------------------------------------------------------------- Utilities --------------------------------------------------------------------------- alias list current alias definitions in use alias abbreviation text substitute text whenever abbreviation is typed unalias abbreviation remove the alias definition for abbreviation cal [month] year print a calendar cc [-c, -o name] file.c... [objfile.o...] compile a C program from file.c Options: -c create object file(s) file.o... only -o name call program name instead of a.out date print the date and time grep pattern file... print lines containing pattern in file... head file... print first 10 lines of file... mail read mail (type ? to see options, q to quit) mail username... send mail to username (end message with a period at the beginning of the line) man command display on-line manual page for command pwd print working directory tail file... print last 10 lines of file... vi [file...] edit file... with full screen (visual) editor