Before you go to your lab time make sure that you know the login and
password for mentor. This is the same account and password that you use
for the PCs in the Purdue computer labs. If you don't know your PUCC login
and password go to MATH-231 to get it before your corresponding lab time.
login: <your-pucc-login>
Password: <your-password>
Now logout typing
mentor.cc.purdue.edu% chsh
Changing login shell for <your-login> on *all* ACMAINT hosts.
Old shell: /bin/csh
New shell [/bin/csh]: /usr/local/bin/tcsh
mentor.cc.purdue.edu% exitRepeat Step 2 to login into mentor again. After you login you should obtain a ">" prompt that is the tcsh prompt.
> lsThe command "ls" with no arguments lists the contents of the current directory. If you want to see the details of the files type:
> ls -alThe command "pwd" prints the directory path of the current directory. This current-directory is the directory where the shell is currently in. Type:
>pwdThe directory path printed is a list of the directories necessary to reach the current directory from the root directory.
/home/lookout/<some-letter>/<login>
To create a new directory (for example the cs180 directory) type:
> mkdir cs354To change the current directory to the cs180/ directory type:
> ls
> cd cs354You will notice there are no files in there. Now type:
> ls
> ls -alYou will see two files: "." and ".." One dot means the current directory and ".." means the parent directory.
To change the current directory to the parent directory type:
> cd ..The home-directory is the directory where all your files are stored and is where the current-directory points to when you login. To change the current directory to your home directory type "cd" with no arguments. Type:
> cdSometimes you would like to go back to the previous command. To do that in tcsh type the <up arrow> (the key that has the arrow pointing upwards). Type:
> pwd
> ls
> <up arrow>several times and you will get the last commands. To execute the current command displayed type <ENTER>. You may also type the <down-arrow> to go to the next command.
For example, type <up-arrow> until you find the "ls -al" command and then type <ENTER>.
If you have committed an error while typing, you may use the <left-arrow>, <right-arrow>, or <backspace> to move the cursor and correct it.
You don't need to type all the characters for a file or command. You may use <tab> and <ctrl-d> to complete the name of a file.
For example, type:
> ls /usr/j<tab>
This will complete to "ls /usr/java"
If the prefix matches several files, you may see a list of files matched by typing:
> ls /usr/p<ctrl-d>
This will show all the files that start with "/usr/p"
Also you can reffer to a list of files by using the character "*". The "*" character in a file name represent one or more characters. For example:
> ls /usr/lib/*.a
Lists all the files that end in ".a" in the directory /usr/lib.
Here is a summary of the commands you have learned and some more:
ls | Lists the contents of the current directory |
ls -al | Lists the contents of the current directory in detail |
pwd | Prints the path of the current directory |
mkdir new-directory | Create a new directory |
cd directory-path | Change to a directory |
cd | Change to home directory |
cp old-file new-file | Copy a file from old-file to new-file |
mv old-file new-file | Rename a file from old-file to new-file |
rm file | Remove a file |
echo "message" | Outputs the string "message" |
<up-arrow> | Get previous command |
<down-arrow> | Get next command |
<left-arrow>, <right-arrow> | Move cursor to the left or rigth. |
<tab> | Path-completion |
> /usr/openwin/bin/xterm -sb &The "-sb" option is for scroll-bar and the "&" is to run xterm in the background. Running a program in the background means that the shell will return a prompt immediately and will not wait until the program completes.
You may open as many xterm windows as you want using the command above.
>/opt/SUNWspro/bin/xemacs &This command will run xemacs in the background. You will see the xemacs window appear on your screen.
You can use xemacs using the pull-down menus like other editors with
a graphical user interface. If for some reason you are stuck in the prompt
at the bottom line type <ctrl-]>