March 16th, 2003, 09:36 PM
Linux Navigation - Part 02
Ok, i have been asked to write a follow up tutorial to my first, Linux
Navigation. This tutorial is going to go into a bit more detail about
random occurences you might see in a bash shell. Note that all of these
commands come from a bash shell. Bash standing for Bourne Again Shell is
basically the most widely used shell enviornment, over tcsh and kourne
Alright then now that we have established that this is going to be the
bash shell, please note that bash-2.05a$ is going to be used alot, thats
just *basically* the command prompt. Like bash-2.05a$ commands here
parameters blah blah..
Anyway, moving on.
Pine - This is a mail client in ascii format on your linux machine, or at
least it should be. cron and several other programs will send 'root' mail,
normally in /var/spool/mail/root . Its a pain in the neck trying to use a
text editor such as pico or vi to read your mail, so most prefer to use
pine or elm.
Now i personally prefer to use pine, because it is simply more efficient
in my personal opinion, but others prefer elm. I recommend that you use
pine, and i will teach you how to use pine now.
root@wherever root]# pine
will open up your mail for you if you have pine configured properly to
look for mail in /var/spool/mail/root (shouldnt be a problem unless you
had a bad install, because it puts it there by default) . Now pine will
open up in the shell and give you several options. Help, Compose Message,
Message Index, Folder List, Address Book, Setup, and Quit. You may either
scroll through these options or press the following commands (just key
? for help
C for compose Message (send email to someone, however you cant usually do
this unless you have an smtp or pop3 of some sort setup.)
I for Message Index - Just where your emails are, normally the ones sent
L folder list
A address Book
S setup (Configure your pine to your personal preferences)
Now whenever you get into your message index, you can just look at the
email by highlighting it and pressing enter. press < to go back to your
previous page or whatever. D deletes message and you will be given the
option to "expunge" the messages marked for deletion afterwards.
On sending mail, you just ctrl^x to send once you have typed it in. ctrl^c
will cancel any action you have made in the process. Now after you send,
your sent messages will then be copied to your sent mail folder.
Ok moving on from Pine, that is pretty self explanatory.
Unpacking .bz2's is a common question i get, on how to do it.
file.tar.bz2 - to unpack this is quite simple. All you need to do is type:
tar xjf /path/to/file.tar.bz2
And thats it, you have untarred a .bz2 // Please note that i prefer .bz2's
because i believe one that they compress files better, and 2 that they are
more efficient in uncompressing.
Note that bz2 stands for bunzip2.
how to create a bunzip2 is also quite simple
tar -cj file list here > file.tar.bz2
If you don't prefer gedit or vi, vim or emacs, and want a quick easy to
use text editor, then pico is right for you.
syntax = pico file or file.whatever it is
<note that you cannot pico a directory >
once you are in pico, to write the file (save it after you edited it) type
ctrl^o, to find something within the file, type ctrl^w, to exit the file,
ctrl^x. Those are the most commonly used commands in pico, but there are
of course others
ctrl^G get help - get help using pico
ctrl^J - justify
ctrl^r - read the file
ctrl^y previous page
ctrl^V next page - very useful when wanting to get to the bottom of a very
large file quickly.
ctrl^k cut text
ctrl^u uncut text
ctrl^c cur pos
ctrl^T to spell
Now pico can be used as an html, php, c++, c, java, xml, dhtml, or any
kind of programming language editor. Just make sure when you type ctrl^o
you save it as the right type, for instance if i were writing a c++
program i would do:
root@whatever root]# pico something.cpp
// c++ code here
Heh i love pico, as a matter of fact, I'm writing this tutorial in it!
To compile a program in C:
open the file in a text editor, save it as the right type (something.c)
gcc -o whateveryouwantittobecalled whateveritis.c
will then compile it.
same with g++ except for its g++ -o something something.cpp instead of gcc
and .c as the usual.
Now i know gcc and g++ are much more powerful than this, but i am merely
pointing out how to get started with this stuff, usually a newb unix user
isn't a hardcore C++ or C developer already, and doesnt have to worry
about say... making shared object files or something of the sort. + this
isnt a programming tutorial, using gcc and g++ can be quite useful in
creating things on your platform, and fixing them.
Welp To end id like to say, I hate vi. Any comments or suggestions, i'm
tired of writing email email@example.com and i can add stuff that you
would like to see me teach a bit. Eventually I will go into more detail
March 16th, 2003, 09:49 PM