| Working with Directories |
| pwd |
Gives you the name of your current working directory. |
| cd dirname |
Changes your working directory to dirname. If you are not in dirname's parent directory, you must use dirname's full pathname. |
| cd .. |
Changes your working directory to the parent of the directory that you are in when you issue this command. If you are at the root, you will remain there. |
| cd |
Changes your working directory to your home directory. |
| ls |
Lists the files in your working directory. |
| ls -l |
Lists the files in your working directory, giving lengthier information about them — including file protection and access privileges. |
| ls -a |
Lists the files in your working directory and shows your hidden "dot" files, as well, including your .login file. |
| ls -lt |
Same as ls -l, but orders the files by time modified. |
| mkdir dirname |
Creates a directory called dirname.
Your working directory will be the parent of this new directory, unless you specify another pathname. |
| rmdir dirname |
Deletes a directory called dirname, if the directory is completely empty. If you are not in dirname's parent directory, you must use dirname's full pathname. |
| Working with Files |
| pico filename |
Uses the editor Pico to open a file called filename. If a file of that name does not already exist, it starts a new one. See section on Pico. |
| vi filename |
Uses the editor vi to open a file called filename. |
| cp file1 file2 |
Makes a copy of a file called file1 and names the copy file2. If there already is a file called file2, it will be replaced. |
| cp -i file1 file2 |
Makes a copy of file1 and calls the copy file2. If there already is a file called file2, the system queries you before replacing it. |
| rm filename |
Deletes a file called filename.
If you are not in the same directory as filename, you must specify filename's pathname. |
| rm -i filename |
Deletes a file after confirmation. Type y to confirm, n to cancel. |
| more filename |
Lists the contents of the file called filename on your screen. Press the spacebar to scroll forward in the file. Type b to scroll back one screenful. Type q to quit. |
| lpr -P pr fname |
Sends a file called fname to a printer called pr. |
| Additional Commands |
|---|
| history |
Lists your previous commands (the default at NYU is 20 of them). !n Executes command number n in the list that you receive as output of the history command. |
| man command |
Obtains online information about the command of your choice. These are the UNIX system's online "man pages".
Press the spacebar to scroll to the next screenful. Type b to scroll back a screenful. Type q to quit the man facility. |
| man -k key |
Obtains online information when you do not know the command name. Replace key with a keyword for the function you wish to perform. |
| learn |
Initiates online instruction in file manipulation, vi, C, and other topics. |
| passwd |
Initiates the password-changing program. Respond, as prompted, with your old and new passwords. |
| pine |
Starts the Pine mail program. See the section on mail. |
| tin |
Starts the network news reader tin Use the up- and down-arrow keys to highlight a newsgroup (or message) of interest; press Enter key to select it. Type ? for help, and q to quit. |
| logout |
Logs you off the UNIX system.
If you have a "stopped process", the system will prompt you. Enter fg to resume the process or logout a second time to abort the process and log off the system. |