Logging in to and out of your account
The
Unix directory structure looks like this:
/
<Slash
is top directory>
users
………….
w
x
…………
wjones
………
<Home
level>
cs112
misc
<account subdirectories>
Manipulating files and directories
Viewing
contents
of a file
Retrieving previously typed commands and file names:
Instead
of typing a command over, at the command line prompt type <esc>-k.
This will fill in the command line with the last command you typed.
Typing <esc>-k
again will bring up the command previous to the first. If you go too
far you can type <esc>-j
to back up.
Pico Editor
To
invoke the Pico editor, at the command line prompt type: pico
Example: raptor:/users/w/wjones>pico
Prog1.cpp
To save the file you have just created or modified
type <ctrl>-o
(control-o), then press enter.
Before you press the enter
key you have the chance to change the name of the file that will be written.
To exit pico type: <ctrl>-x (control-x)
C++ Compiler
To
compile the program that you have created with the pico editor, at the command
line prompt type: g++ <filename>
Example: raptor:/users/w/wjones>g++ program1.cpp
If
your program compiles
without errors the compiler produces a.out in the same directory.
a.out is the executable file.
Executing
and Terminating a Program:
Executing a program:
To
execute the program that you have successfully compiled type, at the command
line prompt type: ./a.out
Terminating
an executing program or Unix command:
To terminate the execution of a program (maybe it's not responding for some
reason) or to terminate the execution of some unix command your can type <ctrl>c.
<ctrl>c
means that you hold down the Ctrl key and the c key simultaneously.
FTP (File Transfer Protocol)
FTP is used to move files from one computer to another. When you are logged on to your ITS Unix account and want to get a file from the public FTP site in the CS Department where I place some program test files you need to use FTP. The following digest of an FTP session is similar to what you should see on your console. The lines shown in blue are either Unix prompts or FTP prompts and the text shown in bold is what you need to type. The rest of the lines are ones produced by the FTP program. Your output may differ slightly from what is shown in the following:
falcon:/users/w/wjones>ftp
ftp.cs.uidaho.edu
Connected to lucky.cs.uidaho.edu.
220 lucky.cs.uidaho.edu FTP server (Version 1.1.214.4(PHNE_23950) Tue May 22
05:49:01 GMT 2001) ready.
Name (ftp.cs.uidaho.edu:wjunk):
anonymous
331 Guest login ok, send your complete e-mail address as password.
Password:
230 Guest login ok, access restrictions apply.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>
ls
200 PORT command successful.
150 Opening ASCII mode data connection for /usr/bin/ls.
total 10
dr-xr-xr-x 3 root root 4096 Oct 15 2001 bin
dr-xr-xr-x 3 root root 4096 Oct 15 2001 etc
dr-xr-xr-x 29 root root 4096 Nov 1 10:42 pub
dr-xr-xr-x 4 root root 4096 Oct 15 2001 usr
-r-xr-xr-x 1 root root 344 Jun 15 1994 welcome.msg
226 Transfer complete.
ftp>
cd pub
250 CWD command successful.
ftp>
ls
200 PORT command successful.
150 Opening ASCII mode data connection for /usr/bin/ls.
total 5
drwxr-xr-x 2 261 root 4096 Oct 23 2001 cs101.karen
drwxr-xr-x 2 262 root 4096 Nov 4 09:48 cs112BillJunk
drwxr-xr-x 3 261 root 4096 Apr 25 2002 cs112kvh
drwxr-xr-x 3 282 root 4096 Oct 15 2001 cs113
226 Transfer complete.
ftp>
cd
cs112BillJunk
250 CWD command successful.
ftp>
ls
200 PORT command successful.
150 Opening ASCII mode data connection for /usr/bin/ls.
total 4
-rwxr-xr-x 1 262 100 446 Nov 1 14:32 File1.dat
-rwxr-xr-x 1 262 100 0 Nov 1 14:33 File2.dat
-rw-r--r-- 1 262 100 404 Nov 4 09:48 File3.dat
226 Transfer complete.
ftp>
get File1.dat
200 PORT command successful.
150 Opening BINARY mode data connection for File1.dat (446 bytes).
226 Transfer complete.
446 bytes received in 0.03 seconds (15.31 Kbytes/s)
ftp>
bye
221 Goodbye.
![]()