After installing a *nix, and if you have not been given the choice,
the
most likely figure is
that you will be brought to a command prompt. For
the
inexperienced, this can be a very
disturbing, and even frightening
experience. But worry not, there are very good commands
to get you
around in
a shell environment.
Note that all the following commands can be preceded my 'man'
without the
apostrophe, to
get a detailed description of variants on how to run
those
said commands. In fact, I would
even recommend doing a 'man man' to
know what
it is all about.:
ls: lists directory content.
cd: will take you to a directory. Usually invoqued with a
following syntax related to where you want to go. eg: cd dirname to go down,
or cd .. to go up.
mkdir: will make a directory, used in association with the name
of the needed directory.
rmdir: will remove a directory, used in association with the name
of the unwanted directory.
rm: will remove given file, does not work for folders.
vim: editor based on vi, can be used at a command prompt or in a
gui. Used in association with a filename that is or that shall be.
tar: compression & decompression program, allows to bring
file size down, like 'zip'
dmesg: description of what is going on in with the kernel. Use as
follow to get to scroll through it: dmesg | less
less: the opposite of more.f a list to be desplayed, if the list
is bigger then the terminal size.
more: file perusal filter for crt viewing. What ever that
means...
mount: mounts a filesystem. Reads /etc/fstab to know where to
mount said filesystem.
xf86config: configuration utility to setup X11 (xwindows)
du: disk usage, used with '-h' disk usage in human readable
form.
ps: reports a snapshot of current processes. I tend to use it
with 'aux'
top: displays linux tasks.
fakeroot: run a command in an environment faking root privileges
for file manipulation. Good to use when building .deb files for example.
cp: copy files and directories.
The following commands need root priveleges (#) to be able
to do
any system
changes. If you don't know what you are doing, don't do it,
unless
you are ready
to learn from your mistakes:
apt: advanced package tool.
apt-get: APT package handling utility. I use it in the following
maner
apt-get update: reads the list of available packages for the
distro
apt-get upgrade: self explanitory, must have apt-get update run
prior.
apt-cache search nameofpackage: search in specefied source
nameofpackage. This one does not need root priveleges. I just put it here
because it goes hand in hand with 'apt-get install.'
apt-get install nameofpackage: install from specefied source
nameofpackage
ifconfig: configure a network interface
iwconfig: configure a wireless netwrok interface
ifup/down: bring a network interface up/down
fdisk: partition table manipulator for Linux, use with EXTREME CAUTION required.
hdparm: hard drive optimization. use with caution, will allow
faster access to harddrives. Read the man pages with this one, or else...
base-config: Debian base system configuration
aptitude: high-level interface to the package manager
Mounting a filesystem on a *nix box:
Every partition under a *nix needs to be inputed into a specific
file to
be mountable. The
exception is with OS X, which can use the standard,
but by
default does not.
Some filesystems will need root preveledges (#) to be mounted, and
some
can be mounted
as regular user ($). This depends on how the fstab entry
for
that particular filesystem is
setup. To show the steps that need to be
root,
there is a # at the begening of the line. If
there is a #/$, those
commands
can be executed as both root and/or regular user. Lines
within ** are
comments.
Example:
Here is where I mount a Olympus D510-Zoom via usb
under
Mandrake 8.2 and 9. I don't
believe it works in 10, since it has been
changed
to some different methode of file mounting.
Note that I don't run Mandrake on any of my machines anymore, and
thus
this part may be
obsolete.
# vim /etc/fstab
*insert the following line into fstab after all the others*
/mnt/olympus /mnt /olympus supermount dev=/devsda1,fs=vfat,--,iocharset=iso8859-1,umask=0,codepage=850 0 0
*save the file* ie: esc wq enter
# mkdir /mnt/olympus
# mount /mnt/olympus
to unmount the said file system:
# umount /mnt/olympus
Here is how to mount a lexar media compacFlash via usb card in Debian:
# vim /etc/fstab
*insert the following line into fstab after all the others*
/dev/sda1 /media/lexar vfat rw,user,noauto 0 0
*save file* ie: esc wq enter
# mkdir /media/lexar
#/$ mount /media/lexar
Here is how to munt an iPod via usb in Debian,
noting
that the iPod was used on a Windows
system, and thus was using fat or
fat32
as a filesystem:
# vim /etc/fstab
*insert the following line into fstab after all the others*
/dev/sda2 /media/ipod vfat ro,user,noauto 0 0
*save file* ie: esc wq enter
# mkdir /media/ipod
#/$ mount /media/ipod (while it is connected)
to unmount the said filesystem:
#/$ umount /media/ipod
# eject /dev/sda (this will tell the ipod it is safe to unplug it, thus
removing the 'do not unplug' message)
*related topic to ipod: how to install linux on ipod. note that I haven't done it yet, since I don't own
one.software to be used with the ipod: gtkpod, allows to search music on the ipod, listen to the music
on the ipod via xmms, and copy music from the ipod to harddrive (unlike iTunes)
Hard Drive Optimization:
*disclaimer: read man page for hdparm, I don't really know much
about this
one, just that
there is lots that can be done to improve system
performances*
# hdparm -t /dev/hda
# hdparm -c1 -m16 -X (these functions are not to be used in that
particular order, they are just there as example.)
Once again, I post this as information, but I am not familliar with
hdparm, and thus can't go into details about it.
Decompressing tar balls:
if nameoffile.tgz
$ tar -xvf nameoffile.tgz
if nameoffile.bz2
$ tar -xjvf nameoffile.bz2
if nameoffile.gz
$ tar zxf nameoffile.gz
if nameoffile.tgz
$ tar -xvf nameoffile.tgz
if nameoffile.zip
$ tar xzf nameoffile.zip
Compiling tar balls:
$ cd nameoffile
$ ./configure
$ make
$ su
# make install
Xwindows:
So far, everything that has been covered can be executed from a
terminal,
with no gui
environment what so ever. But often, we like gui, and so
for
*nix, we invoque the Xwindows.
There are many Xwindows, some better
known
then others, some more featured then others.
Most often, resources
dictate,
or restrict our choices. My Xwindow of choice is blackbox.
There is a
spin
off of blackbox that handles key bindings without extra software
installed,
named fluxbox, but not everybody needs key binding, and so by
keeping
in the
tradition of
less is better, I opt usually for blackbox. Note that os X
is an
exception in that it can and
will function very well without any
Xwindows
installed, due to it's Aqua interface, but an
Xwindows can also be
installed
on top of Aqua to allow for native *nix applications to take
advantage
of
gui. If there is no Xwindows, the only applications that are directly
associated
with the 'true' *nixness of os X will have to be run in a
terminal, and will not be able to run
in a gui form. In fact, if they
are gui
dependent, they will most likely not install, complaining
there is no
environment for them to work in.
Xwindows configuration:
The biggest file that is usually edited to get Xwindows up and
running
correctly is the
XF86Config-4 file (some new systems want Xconf.org,),
both
live in /etc/X11/. Although
most *nix distros now have an assisted
configuration of this particular file, there is the
occasional problem
where
the script will fail, and there will be need to edit it by hand. In
my
case,
I had my first introduction to this file when trying to enable
dual-screen
support
under Mandrake on a single card with dual heads. Of course it
took me
far too long to get
it correctly, but one has to do things wrong first
to
learn how to do them right. If you are
new to a *nix, try not to tamper
with
this too much. Only once you are comfortable with the
shell
environment, and
once you understand how to edit a file in a terminal, only then
should
you
attempt editing this file, since to my experience it will not allow for
editing
when logged into X. If you wish to edit this file, make a
backup
before hand.
Logging into Xwindows:
This can be done in different manners, some of which are dependent
on your
distro. In
Debian, the most likely figure is that the Desktop
environment was
selected during install
(especially if you are a beginner) and so GDM
(Gnome
Display Manager) will kick in
automatically. I personally prefer XDM,
because
it allows me to execute different scripts
when I log into my Window
Manager.
But GDM has it's advantages, such as allowing the
user to choose which
window
manager to startup, just by selecting it. There is a third
Display
Manager
KDM (KDE Display Manager) which is very similar to GDM.
For a beginner, I would recommend GDM, since it has the option of
choosing
which Xwindows
to run (KDE, Gnome, Blackbox, Enlightenment, etc)
For an advanced user, I would recommend XDM. It is older, and
doesn't
look
as good, but has
the advantage of looking for startup scripts (.xinitrc
or
.Xsession depending on the distro)
There is also the option of disabling the Display Manager, and
using the
command: 'startx'
or 'xinit' from the command line. I personally like
the XDM
option, since I do most of my
work in a gui enabled environment. Note
that
'startx' will allow for usage of startup scripts,
but not xinit.
Here is a copy of my .xsession. For
this
version of the file to work, it is necessary to have
blackbox, aterm,
bbpager, bbkeys, and gkrellm installed.
For the systems that use .xinitrc, well, the file's content can be
exactly
the same as that of
the .xsession, it's just a filename difference.
Blackbox configuration:
~/.blackboxrc: configuration file for most of the options of
blackbox. It
allows you to choose
where you want blackbox to go find it's menu
configuration file, and it's theme files amongst
many other things.
*~/ means: in home directory*
iSight on Debian Linux kernel 2.4.27
More to come soon...
© 2005 Solomon Latham