Familiarizing Yourself With Linux
by David
Something about not knowing everything...
This is intended to be an absolute beginner's guide to familiarizing
yourself with Linux. Where prior experience is more useful, it will be
noted. I don't claim that this will be perfect, as I am human, and I am
also quite new to Linux myself, nor is my command of the english language
perfect. So bare with me through misspellings. But I will do my absolute
best to ensure that all linux commands and what not is without error.
What am I doing?
You may have noticed that many books and sources tend to describe things
and leave it to you, the reader, to understand certain things. I will try
not to make those assumptions. I've noticed, too often, that I have to
figure out how to make the command work for me, or understand certain
things that they assumed I knew. Again, I will try not to make those
assumptions. I will try to explain everything, including what commands
do, in what way they should be entered, what things will do.
I'm also just trying to give back to a community that has given me a lot
of help, and will continue to do so. Try getting that in the DOS/windows
world without paying.... much less get accurate help, quick and efficient
bug fixes ...
Introduction
So you just grabbed linux, and now you're trying to learn it. Somehow
you've managed to install it. If you've done this by yourself, good show.
If a friend did it for you, you'll be thanking him/her a billion times
before too long (because linux rules, as you'll soon find out, especially
if you're coming from dos/windows and begin to experience linux's help
systems). Now you've got to learn how to get things done. There exists on
this site a ton of resources; for specific answers you can turn to the
forums, for general help, we have NHF's.. And this is one of them.
One rule of thumb with unix/linux is to NOT do everything as root. root
is the superuser, and therefore has COMPLETE access to EVERYTHING. This means that, as root, you can delete,
rearrange, edit, and screw up ANYTHING on the system, from system files
to hardware devices to you name it. If you have not created a user
account, do so. It is imperitive that you do everything you can as a not
very priviledged user, so you will have all sorts of safety nets. To
create a useraccount, follow the directions given in your installation
documentation that came with your cdrom(s), or if you didn't install from
a cdrom(s) and don't have documentation, ask whomever helped you install
it, to make sure a user account is created and that you have access to
it.
Man Pages
On your machine will be all sorts of documentation. Some come standard,
some you must choose during installation. Hopefully you've chosen to have
them, directly or indirectly. If not, we'll get you going. First thing you
need to know about are the man pages. The man pages exist on every system,
unless, for some reason, they were not installed during installation. To
check if you have man pages available type:
$ man argument
man is the program/command that you type in at
the prompt, $, the page you want is the
argument. If you want to view the man pages for the command mv (which is the command used to move a file to
something/somewhere else), you would type in:
$ man mv
Make sure to press the Enter (or Return) key, as nothing will happen
until you do. If you don't have the man program/pages installed, look to
your cdrom from which you got linux. If you didn't install linux from a
cd, ask whomever helped you install it (from whatever source) and see if
they can help you locate the man installation
stuff. If it's on the cdrom in the form of an rpm *, find the rpm file and install it as root.
$ rpm -i man_files.rpm
Please note that man_files is not an exact name
for the file, but the filename should start with man. To find the file, look through the each of the
directories (use the cd command followed by a
space and then the name of the directory. cd ..
moves you to the parent directory, just like in DOS) of the cdrom with
the command:
$ ls -al man* | more
A description of the previous command will you help you understand what
it does. ls is the command to list files in a
directory, much like DOS's dir command. -al are
arguments to aid in the search, a=all, l=long format. | more pipes the command through a program called
more which will print the output one screen at
a time, much like DOS's /p argument. Once finding the file in the
generated output, type the letter q, and this will bring back the prompt.
Then you can enter rpm -i man_files.rpm command
above with the correct filename. This will install the rpm for the man
files. Then you can have a ton of fun, and believe me you will be
grateful for man pages, learning linux.
* If you don't have rpm capability, the way to know this is if you see NO
rpm's on your installation cdrom(s). If you
want to get rpm capability, go to www.rpm.org, but you don't
need rpm's to install things. There exists an
NHF on this site about installing things from source, you are well
advised to read this regardless of your position now, unless you already
know everything there is to know about installing from source. There will
also be an NHF about creating and installing MAN pages. Read that too.
HOWTO's (and the 'thank god for the LDP')
Now we move on to the LDP (Linux Documentation Project). If you thought
that the man pages already had Bill Gates and his DOS and windows help
systems beat, just think about this, we're not even half way through. Oh
yeah, AND everything you will see here is $free.99 !!!
A long time ago, in a galaxy very much like this one, a bunch of people
decided that the man pages weren't enough. So they created the LDP. The
LDP, probably among other things, who knows, gathers up a bunch of
documentation in the form of HOWTO's. Then they make these available
online. A person takes a certain topic, something that many people have
problems figuring out, such as How To get your cdrom accessible by
nonroot users, and writes a HOWTO about it, and sends it to the LDP, and
they post it for everyone. HOWTO's tell you How To do something. They
have HOWTO's for so many things, you'll say 'thank god for the LDP'.
Somewhere in the neighborhood of /usr/doc/HOWTO
on your filesystem will be the HOWTO's. To view them, just go in there
and open them up. They are usually installed in all kinds of formats such
as plain text, pdf, and html. But before we open up the HOWTO's, I should
make a mention of what all that blue stuff above meant. Your filesystem
is organized in a nice way and the main directory of the filesystem tree
is / . It's sort of like your C:\ drive in
DOS/windows. Each directory is dilineated by another
/ so that /usr is a directory inside
the / . And so doc
is inside usr. Here's a demo of what that looks
like:
/
|
-----------------------------
| | | |
dir1 dir2 dir3 usr
|
doc
|
HOWTO
Now you see why they call it a tree. When using the cd command/program you should not use the / to move around, except when giving exact names
(absolute references). If you are in /usr and
want to move into the directory doc use cd doc. This is a relative reference (relative to
where you are), meaning it will only move you there if it's position is
directly accessible (inside the your current directory). Absolute
references are absolute, meaning you can move to it from anywhere. So if
you're in /home/george/Programs/Foo and you
want to move to /usr/doc/HOWTO, you should use
the absolute reference in the command as shown like this cd /usr/doc/HOWTO .
To open plain text files, you can use your favorite text editor. Mine is
emacs, so to open it with/in emacs do:
$ emacs file_name
where file_name is the name of the file. To
view html files, just open up netscape (if you don't have it, go to
netscape's website www.netscape.com, and grab one of their versions for
linux. Yes they have a little info on how to install it.) and view your
files. In the Location bar of netscape (where you enter the url), type in
file:/usr/doc/HOWTO . file: represents files on your physical machine,
/usr/doc/HOWTO represents the absolute
reference of the location in your filesystem. To view the contents of
your /home/bob/Programs/MyProg directory, in
netscape, just type file:/home/bob/Programs/MyProg and you'll be there,
again you must hit enter/return. Netscape is a good way to surf your
filesystem. It won't let you edit or remove anything, so you can't do
damage.
The LDP's homepage is: http://metalab.unc.edu/LDP/ You can find all sorts of
goodies there, including links, HOWTO's in a bunch of different formats,
and what your parents are watching on tv.
--help , and how you can make the program/command work for you
In the beginning of time, god said 'Let there be light', and there was
light. And the devil said 'Let there be an evil Microsoft', and Bill
Gates was born. And then unix programmers said 'Let there be help', and
they entered into their code the facility to ask the program to generate
some helpful comments.
If you want to figure out a few of the useful arguments you can have the
program work with, all you need to do is to type --help as the argument. Here's an example, with the
mv command:
$ mv --help
Now, remember that first you type the command (the name of the program in
most cases) and anything after that is an argument passed to the program.
So now our argument is --help . This will
cause the program to generate any ouput it was designed to do, to pass
helpful hints as to what you can do with the program. This output will
not be as substantial as the program's man
page, but it will be very helpful indeed. It will just give you a quick
list of what the programmer(s) thought would be the most useful
arguments.
Below is the output on my machine. This may not be exactly the same on
your machine, but it will be similar.
$ mv --help
Usage: mv [OPTION]... SOURCE DEST
or: mv [OPTION]... SOURCE... DIRECTORY
Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.
-b, --backup make backup before removal
-f, --force remove existing destinations,never prompt
-i, --interactive prompt before overwrite
-S, --suffix=SUFFIX override the usual backup suffix
-u, --update move only older or brand new files
-v, --verbose explain what is being done
-V, --version-control=WORD override the usual version control
--help display this help and exit
--version output version information and exit
The backup suffix is ~, unless set with SIMPLE_BACKUP_SUFFIX. The
version control may be set with VERSION_CONTROL, values are:
t, numbered make numbered backups
nil, existing numbered if numbered backups exist, simple otherwise
never, simple always make simple backups
Report bugs to fileutils-bugs@gnu.ai.mit.edu
$
The line with the first $ is where I entered
the command and it's argument --help . Below
that is the output that the program gave to me. First it explains its
syntax, meaning how things should be entered, because this is the way it
reads them. The ... is an elipses, which means
additional arguments may be placed here, such as more SOURCE files, to be moved. Then it gives a few of the
more useful arguments (OPTIONs) that can be
passed. Let's take a look at one of these lines in detail, and then you'll
be able to figure out what the others mean.
-b, --backup make backup before removal
The -b is an arugment that can be passed. The
--backup is another way of passing the
argument. They are two ways of telling the program to do the same thing.
The comma just seperates them. It has no special meaning and should NOT
be included, nor should both be included in a single command. If you know
what you're doing, and know that doing so will work for your particular
purpose, then you can ignore me, but then you probably won't be reading
this anyway.
The next part of that line is a description of what the argument asks the
program to do. The particular argument in discussion asks the program
mv to make a backup before
removal . Got it? Now you can understand the rest of that secion.
It just gives more arguments, and possible different ways of entering
them on the command line, and then a description of what they do. Please
understand that the descriptions given by --help and the man pages
are somewhat terse, but HOWTO's and manuals exist for many of the
programs. A bunch of information on the gnu utilities can be found online
at www.gnu.org.
Online World of Fun
Last, but in no way possibly the least, it's now time to go online and
have fun. You've already managed to find a really great place for linux
newbies and users. There are a million others.
Resources till you bleed
www.linuxnewbie.org -where you are now
www.linux.org
www.linux.com
www.gnu.org
www.linuxresources.com
portico.org
Programs
freshmeat.net
|