Unix commands: Unix intro page 2
Using the Macintosh (Unix) terminal program, the command to connect to the server is:
ssh yourusername@ruacad.radford.edu
"yourusername" is the same as your e-mail name, minus the "@radford.edu"
The ssh program will display the server's request for your password, the same one you use for e-mail or the RU portal.
When it accepts your password, you are logged into the Web server, and you can use Unix commands or run Unix programs on that "remote" machine.
The first thing you will see on the server is a "shell menu" that looks like this:
TERM=vt100 Version 3.0 DATE: 08/24/09
Radford University Master Menu
-------------------------------------------------------------------
1) Mail Menu
2) News Menu
3) Inactive Selection
4) Inactive Selection
5) Inactive Selection
6) Library / Reference Menu
7) Inactive Selection
8) Talk IRC
9) Exit to C-Shell (command prompt)
10) General UNIX commands & Utilities
11) Reserve classroom multimedia cart
12) View MOTD
13) Lynx (INTERNET - WWW Browser)
14) Logout
(q) Quit - Logoff
(h) help
Your Choice:
Choose Option 9 (Exit to C Shell) and you will be at the Unix command line, with your Macintosh or PC set to emulate a vt100 terminal.
We will work in a common unix editor called "pico." If you are familar with another unix editor, such as emacs, xemacs or vi, feel free to use them, but you are on your own about their editing commands. One benefit of pico is its simplicity -- all of the main editing commands are visible at all times.
You should not run into this problem, but... IF the server types back that you are using a terminal that cannot run pico, type this command:setenv TERM vt100That will reset the server to expect the more common "vt100" style terminal settings.
Notice that when you have logged in, the terminal "command line prompt" changes from the name of your Macintosh to the name of the server, followed by the "directory path" to your current position on the computer.
ruacad @ /home/rstepno/ >
You can use the "cd" (change directory) command to get into your
public_html directory and the "ls" (list) command to list the
documents in
that directory. First, type "cd public_html" (without the quote
marks)
This is what the command-line
prompt looks like when I am in the public_html directory, which is my "www.radford.edu/~rstepno" Web space, then
type the "ls" (list files) command.
ruacad @ /home/rstepno/public_html >
ruacad @ /home/rstepno/public_html > ls
(Notice that Unix uses the slash mark / to indicate directories contained within directories -- "folders within folders" to Mac and Windows users.)
Common commands:
- To see a longer version of the list of documents and directories,
add a
space, a hyphen and an l (for long):
ls -l
- To change to a new directory
(folder) within the current directory:
cd nameofdirectory
- To change back to the directory "above" the current directory:
cd ..
(The two dots mean "up one directory level." Remembering that the slash mark can separate directories, can you guess what "cd ../.." would do?)
- To run a simple text editor:
pico
- To edit a new or existing html document with
pico:
pico documentname.html
- To quit pico: Control-x (see the menu at the bottom of the screen, where ^ mark means "Hold down the control key while you press a letter key.")
- To logout of ruacad and close the ssh connection, just type "exit"
- To close the terminal: Type exit again, then choose "quit terminal" from the Macintosh Terminal menu.
Shortcuts: The Unix command line has two useful shortcut keys built in -- the tab key and the up-arrow key.
The up-arrow key will step backward through commands you have typed recently. The tab key will auto-complete all or part of a command. That is, if you type "pico m" (on the way to "pico myfile.txt") and press the tab key, the system will finish typing for you, if that is your only file beginning with "m." If you have both "myfile.txt" and "myfile.html," the tab key will get you only the "myfile." part of the name -- you will have to finish adding the "txt" or "html"
Editors: Most Unix computers, including the ruacad computer, have other editors, but pico is probably the simplest, because its basic control key commands are always visible on screen. Other popular Unix editors include nano (based on pico), vi or vim, and emacs or xemacs.