| mkdir | Make directory | creates a new
sub-directory. To use, type mkdir |
| pwd | Print Working Directory. | Displays WHICH directory you are in (Shows the current directory location). |
| ls | List current directory contents | Shows list of files in current directory |
| cd | Change directory | Type the name of the directory after the command (e.g., cd Mail to go the Mail sub-directory of your home directory). When used alone, it returns you to your home directory. Or use cd $HOME to get to your home directory |
| cp | Copy files. | Type the command followed by the old file and the new file names, in that order, such as cp oldfile newfile, and press Return. |
| mv | Move files | Type the command followed by the old file and the new file names, in that order, such as mv oldfile newfile, and press <Return>. |
| rm | ReMove file | Type the command followed by the file name, such as rm filename, and press <Return> Can be used with wildcard -- rm *.o would remove all files ending with .o extension (these are usually object files) |
| ls -l | Long List of files | Gives file names, as well as mode, owner, group, size, and creation date and time. |
| ls | Short List of files | Gives
only the files names.
If a sub-directory is given after the ls or ll command, the
files listed will be those in the given directory. Otherwise, files in
the working directory are used. -C used with ls, shows file
names in Columns. -a When used with ls or ll, gives hidden files as well. |
| cat | Concatenate files | Without redirection, cat prints the file or files to standard output (terminal display). With redirection, files are concatenated to the specified location. For example, cat file1 file2 > file3 copies file1 and file2 into a new file, file3. |
| more | Displays contents of file to screen 1 page at a time. | Used instead of cat command so that entire file can be seen page by page on the screen. Example: more hello.cpp displays the contents of file hello.cpp to the screen 1 page at a time. |
| lp | print file to printer | Example: lp Hello.java would print the file named Hello.java to the printer on the unix system. |
| a2ps | print file 2 pages per side | Example: a2ps Hello.java prints the file with 2 pages side by side, in landscape (can save paper if you can still read the small print.!) |
| r | Repeat or RECALL command | Used with a command to REPEAT last command. Example: r more Repeats the last more command you gave |
| history | Gives a history of commands used | Gives the last 20 commandsyou have typed at the terminal. Used in conjuction with r command (repeat) r 123 means repeat the command 123 (you get the number of the command from history) |
| passwd | Changes password on system | System prompts for old password, then for new password then asks for a verification of new password. Passwords must have 6 or more characters, at least 1 must be a NON-LETTER. Passwords are CASE-SENSITIVE as are ALL unix commands.! |
| emacs | recommended text editor. | Used to create files containing a program or any text. Example: emacs Test1.java opens the emacs editor and you are now creating/editing a file called "Test1.java". REMEMBER case sensitive file names. |
| exit | logout (exit or kill) of the terminal session. | In X-Windows make sure you logout of the Windows session also on the toolbar under the "-" box. |