Things To Do at the Unix $ Prompt

S. Sadi Seferoglu


Getting Help (at the $ prompt) :

To get help in being introduced to Unix type out. (out=Online Unix Tutorial).

To get in-depth descriptions of using the Unix, type man man.

To get help on a certain command type man and command, and man -k and a keyword.

(Ex: $man ls). (Ex: $man spss) (Ex: $man -k directory)

To read text on the screen press Space bar (to view it one page at a time) or Enter (to read line by line).



At the $ sign:

To view files in the current directory, type ls or dir (and $ls -la for all files with long listing and $ls -alF for all files with file type) and press return. (Also ls dirname to see files in a subdir.)

To go into mail, type pine or mm and press the carriage return.

To get information about a user, type lookup and press Enter. (Search can be done by entering either first name, last name, or userid, of the user). If there is more than one user with the same first or last name, you will be asked to enter the userÕs department or title. (Ex: $lookup ; $ lookup john doe ; $lookup sss31).

To see the users currently logged in, type finger or who and press Enter. For users at another location, type finger userid and the node. (Ex: $finger myfriendÕsuserid@engin.umich.edu)

To communicate with other users, type talk and the userID of the person and press Enter. (Ex: talk sss31)

When the other party responds the screen will be diveded into two windows, and the two parties may type simultaneously. If you wish to talk to a user on another host, type user@host. To exit Talk, press Control C.

To change password, type passwd and press Enter, then enter your current (old) and new password when asked. (A combination of lowercase and uppercase characters and numbers should be used in password.)

To see (and reuse) the commands used previously, type set -o vi and press Enter. Then press Esc key twice, and then press the keys k and j (to go up and down). You should see the commands you entered previously. To get out of this mode, press i

To create a subdirectory within current directory type mkdir and dirname press Enter. (Ex: $mkdir Letters).

To delete a file, type rm filename or del filename and press Enter. (rm=remove=del=delete).

(Ex: $rm myfile.txt) After this the user will be prompted (rm:remove myfile.txt?), Press ÒYÓ if you are sure.

If you cannot delete a particular file with this method, put the file in quotas. (Ex: $rm Òdelete-myfile-txtÓ)

To remove a directory, type rmdir dirname, and press Enter. ($rm news) (Assuming news is a directory name). If there are files in a directory, the files have to be deleted before attempting to remove the directory.

To rename a file, type mv oldfilename newfilename . (mv=ren=rename). (Ex: $mv myfile.txt herfile.txt).

To copy a file to a subdirectory, type cp file directoryname(=destination) / filename.

(Ex: $cp myfile.txt letters/letter1). This will copy the file myfile.txt into the directory called letters and name that file as letter1. (Assuming that the directory letters exist).

To duplicate a file, type cp filename newfilename. (Ex: $cp myfile.txt myfile2.txt).

To change current directory to a subdirectory, type cd dirname. (Ex: $cd news).

cd ~ takes you to home directory.

cd .. closes the subdirectory you are in.

pwd shows you which directory (current directory) you are in.

control p displays the (last) commands you use

whoami shows who you are, (this is one word). (Ex: $whoami).

me shows you detailed information about your account.

quota -v displays a summary of disk usage and connect time.

head displays the beginning of a file.

tail displays the last part of a file.

date display the date and time.

cal displays a calendar.

> redirects output from screen to disk file.

< redirects input source from keyboard to disk file.

| pipes output of command on left to be the input for command on right of Ò|Ó.

cal > november puts calendar into a file called november.

who > today puts the list of users (who are on the system) into a file called today.

who | sort > today puts the list of users into a file called today after sorting the list.

more today (page today) shows the content of the file today one page at a time. (Press Space bar to read one page at a time or press Enter to read line by line.)

cat (=concatenate) joins files or display file contents on screen.

cat today november combines the content of two files (today and november).

cat today november > info combines the content of two files and names new file as info.