The Experienced Unix User Level

The Experienced Unix User Level

This page needs a lot of work; more information will be added periodically


Shells & Compilers
An explanation of what they are, how they work, and what you can do with them.
Printing Commands
Various ways of formatting documents for printing
Sed & awk
For Working With Columns
Ftp
File Transfer Protocol - for downloading files
Foreach
For Working With Variables
Crontabs
How to make things run when you aren't even around!
Dealing with Data
Billing
An overview of the LOCF Recharge Billing command, and process.


Shells & Compilers


Printing Commands


sed & awk


ftp


LOGGING IN WITH FTP

Ftp stands for File Transfer Protocol, which is used to freely download (and upload) files from the internet using anonymous logins. Almost all network sites currently offer anonymous ftp, via a designated ftp server.

To login to one of them using ftp, simply type:

[589] jess@sol:/u/jess% ftp ftp.apple.com
for example, where ftp.apple.com is the desired ftp address. The output should look something like this:
Connected to ftp-server.apple.com.
220 ftp-server.apple.com FTP server (Version wu-2.3(1) Tue Mar 19 13:41:39 PST 1996) ready.
Name (ftp.apple.com:jess): 
At that point, you should enter anonymous as your login name. When prompted for your password, enter your fully qualified email address (jess@ucolick.org, for instance). Then you will be dropped into that particular site's special ftp directory, where you can perform normal commands, such as ls, and cd. To see a list of available commands, type help.

There are mainly three functions for which you would use this protocol, and those are to quickly and easily send a file to another site without corrupting it (which email can't always do), to pick up files in such a way, or to make many files publicly available without creating a security risk for your site.

Ftp operates in two modes: ascii and binary. If you are transferring a normal text file, or even a formatted one, ascii is your mode. However, if the file is binary, or data - in other words, unreadable - then you want binary. To be sure you are in the right mode, type ascii or binary at the ftp prompt to enter those modes, respectively.

To download, or pick up, a file, type get filename at the ftp prompt, and it will automatically go to the directory you were in when you began your ftp session. This is why you should figure out where you want the files and go there before you even begin.

To upload, or drop off, a file, type put filename at the ftp prompt, and there it will be left. This only copies the file, so the original will stay in place.

When you are done, type quit.

These days, of course, most of the above procedure is somewhat unnecessary, thanks to the incorporation of ftp into the World Wide Web. Chances are, your World Wide Web browser can automatically download files with ftp, and all you have to do is pick a filename, and click on it.


USING OUR FTP

If you would like to make your own files available via ftp, Lick provides you the opportunity on our ftp site. Copy your files to the

        /usr/local/ftp/outgoing
directory, as seen by Sun machines. Create a directory which matches your own user name. Insert the appropriate files into your username directory. Verify that the permissions on your directory/files allow everyone to enter your directory and read your files.

These files will automatically be deleted three days after their insertion - this is purely for temporary access.

Your local ftp files must copied via standard Unix commands, NOT by ftp (see below for more information).

For remote colleagues to access our ftp site, they should use the name, ftp.ucolick.org, rather than attempting an ftp login to one of our public machines. Outside users will see the entire directory structure, which we see as /usr/local/ftp, as ftp://ftp.ucolick.org/pub. In other words, to access it via the WWW, they could just use the above URL address, or to directly login, do the following:

% ftp ftp.ucolick.org
where they will automatically be deposited in the /usr/local/ftp directory, and should cd to pub to download and upload files.


Outsiders see /usr/local/ftp (the anonymous ftp directory as seen by Lick Sun Machines) as /pub on ftp.ucolick.org

incoming/
Directory for astronomical researchers elsewhere to put files which will be picked up by local Lick users. See the incoming readme file for details.

outgoing/
Directory for astronomical researchers at Lick to put files which will be retrieved by remote colleages. See the outgoing readme file for details.

users/
Directory for astronomical researchers at Lick who need long-term storage of anonymously available files. See the long-term use readme for details.

src/
Various and sundry software developed at UCO/Lick This is where you will find what used to be in UCOSYB and other top-level directories prior to 8/16/95.

www/
Remnants of the early prototype of the UCO/Lick WWW service Now see http://www.ucolick.org

No warranties of any kind are implied.


foreach


crontabs

At UCO/Lick, all users have access to the crontab feature of Unix. This enables one to set commands to be executed at a specified time - the only requirement being that the computer from which they run (and any they rely upon) be up and running.

To try this out, type the following at your command prompt:

[190] jess@helios:/u/jess% at 14:10
at> Mail username < filename
at> <EOT>
job 18288 at Wed Apr 10 14:10:00 1996
[191] jess@helios:/u/jess% 
where username is your username, or email address, and <EOT> is where you typed <CONTROL D> This will cause an email to be sent to you, containing filename at the time, 14:00, which in this case would be 2pm. Or, to call a script, do this:
[196] jess@helios:/u/jess% at 14:20 /u/jess/bin/example
job 18288 at Wed Apr 10 14:20:00 1996
[197] jess@helios:/u/jess%
where /u/jess/bin/example is the script. It is important to use fully explicit pathnames, rather than relative ones. You will be sent an informative email for each cronjob after it has been processed.

If you start getting really efficient with cronjobs, you could also create cronjob file, called a crontab. There you would keep a list of what commands you want executed and when, which is essentially what at does, except with a crontab it stays until you remove it.

To create one, do this:

[590] jess@sol:/u/jess% crontab -e
Now you will be sent into the vi editor. If you don't know vi, get out while you can. Type :q!. Then go here and learn it. Otherwise...

To view your crontab without editing it, use the -l flag:

[591] jess@sol:/u/jess% crontab -l

Dealing with Data

Tar

dump

compress

gzip

cpio


billing


Return to the Index?
Comments/Questions/Suggestions to:

NICS
UCO/Lick Observatory
University of California
Santa Cruz, CA 95064
1 831 459 2303