pine
: To read and send e-mails.
Usage :
pine
mail [email protected] < file
: To send a file without going
through an e-mail program.
tar
: To collect many files and directories in one file preserving
the directory structure.
Usage : To make a tar
file all_files.tar
tar cvf all_files.tar file1 file2 files*To un-tar
all_files.tar
, go to the directory to unfold and do
tar xvf all_files.tar
gzip
, bzip2
or compress
: To compress a big file.
Usage : To compress or zip a file
gzip file or bzip2 fileTo decompress, or to unzip a zipped file
gunzip file.gz or bunzip2 file.bz2
Now that you have created a wonderful program or a beautiful document, maybe you'd like to show it to somebody or maybe somebody already sent you their handy work. So to read e-mails, type
HAL9000> pineThat'll get you into
pine
. I can't explain all the
intricacies of pine
here, but it's quite intuitive. The cursor
control usually works as one expects it to work, and there is a menu
bar at the bottom showing what the available commands are and what they
are for.
To summarize:
enter
.
c
.
r
.
d
.
s
.
<, >
. Try it. See what it does.
pine
, press q
.
PINE 4.58 MAIN MENU Folder: INBOX 10 Messages ? HELP - Get help using Pine C COMPOSE MESSAGE - Compose and send a message I MESSAGE INDEX - View messages in current folder L FOLDER LIST - Select a folder to view A ADDRESS BOOK - Update address book S SETUP - Configure Pine Options Q QUIT - Leave the Pine program Copyright 1989-2003. PINE is a trademark of the University of Washington. ? Help P PrevCmd R RelNotes O OTHER CMDS > [ListFldrs] N NextCmd K KBLockGo to
SETUP
then choose CONFIG
.
In it you will find many, many options including the editor.
To send a file directly to other user without going through an e-mail program, you can do
HAL9000> mail [email protected] < foo.txtBut this works only if
foo.txt
is an ascii file.
To send non-ascii files, use attachment as explained below.
Now suppose you want to send files foo_1.txt
through
foo_20.txt
. You can send it one by one.
However, that's time consuming, prone to errors, and quite
frankly, the other person will get horrified to receive 20 separate
mail messages for 20 separate files because he/she has to edit out all
the mail headers one by one, put them in the right directories, etc.,
the horrors. So, be smart and considerate and use tar
.
The Unix utility tar
comes in quite handy when you want to collect a
number of files, even directories, in one file.
The word tar
originally meant ``tape archive" but these days, it is widely used to
just collect a lot of files in one convenient file. To do so
HAL9000> tar cvf all_foo.tar file_1 file_2 foo_*.txtHere
cvf
means ``create (c)
a file (f)
showing what you are doing verbatim (v)
''.
As before, *
in Unix means ``anything" or the
``wild card". This will
create a file named all_foo.tar
which contains
file_1
, file_2
and
foo_1.txt, foo_2.txt, ..., foo_a.txt, foo_b.txt, ...
.
So now send all_foo.tar
to the person at the other end.
A tar
'ed file is a binary file. And as such, it loses bits
and pieces if you send it through e-mail as a body text. Send it using
`attachment'. When you compose a message, you will see `Attachment' in the
header. Just provide the path to the file you want to attach.
A word of caution. If you make a mistake and omit the tar
file to be
made (all_foo.tar
in the example above),
then the first file listed will be taken to be the tar
file to
be made (file_1
in the example above).
You can guess what will happen then: The content of that first
file is destroyed. So be careful.
Now, if you happened to
be the person at the receiving end of a tar
file, do
HAL9000> tar xvf all_foo.tarHere
xvf
means ``extract (x)
from a file (f)
,
showing what you are doing verbatim (v)
".
This will now create all the foo_*.tex
files in the directory
all_foo.tar
is in.
If you received a tar.gz
file, you can first gunzip
it
and do the above or you can simply do
HAL9000> tar zxvf all_foo.tar.gzNote the additional
z
.
If the files you are sending out are really big ones, then you might
wish to compress it first. The original Unix compress command is,
funnily enough, compress
.
which produces a .Z
file.
These days, the ``GNU zip", that is gzip
or the newer bzip2
are more commonly used since they are more efficient. To gzip
or
bzip2
,
HAL9000> gzip all_foo.tar or HAL9000> bzip2 all_foo.tarThis produces a file
all_foo.tar.gz
(all_foo.tar.bz2
)
where the extension .gz
(.bz2
) means it is
gzip
'ed (bzip2
'ed). To decompress,
HAL9000> gunzip all_foo.tar.gz or HAL9000> bunzip2 all_foo.tar.bz2Incidentally,
gunzip
will also unzip the Zipped files with .Z
extension.