linux starting page
start at the beginning...
first youll need to back up all your files. your hard drive needs to be completely wiped.
consider it a leap of faith. youre about to lose everything, and gain it all back again with some interest.
save only what is necessary.
grab the redhat 7.2 iso images. burn them to cd. boot to the first one.
sometimes this can be a process in itself. particularly for notebooks.
generally, you can just reboot with it in the drive, or set the option in the bios somewhere...
this is system-specific information, so include your information if you seek help:
- motherboard/cpu
- graphics card
- sound hardware
the installer is largely graphical. it should walk you through a procedure which will include:
- setting a username and password for the system
when you do this, set the root password and also create a user for yourself.
it is safer to log in as a user; you have less permission to go screwing with our devices.
you can type 'su' to become root at anytime, so do that on demand.
- choosing software to install
- partitioning your disk
this part requires some thought. a few partitions are required:
/
/home
/swap
/usr
/var
/c is your windows c drive, mountable, readable and writable under linux. you will have full access to all files on the c drive.
size out the partition
these partitions need to be sized by you before installation. this is the hardest part of the install.
try to size the partitions effectively.
/ will contain /boot, which is where your kernel executables will reside(compile new ones when you feel like it).
/ need not be huge, but give yourself enough to hold a couple of kernels...they run ~2-3MB each.
mines a couple hundred megs.
/home will contain the "home directories" of all users on the system. "userland" is a safer place for programs to be run.
/home is worth making large enough to hold software you might want to download and use as a "user", but i sized my /usr partition to the majority of the disk.
/usr will be used to store local software which requires "root access" to run, e.g. sw which uses devices attached to your computer.
/usr contains most of my software, it is also where i store large quantities of data such as mp3s.
/usr on my system is ~70% of the disk.
/var is a system-required partition. dont save files there.
i think system performance may benefit from a larger /var... mines 9.6GB ~10% of the disk.
make all of the above partitions linux ext2 filesystem type - or use the new ext3 with redhat7.2. i hear its better.
your c partition can be reformatted for windows, make it the FAT32 type. you can run windows installer later on just that partition. it is all the installer will be able to see.
heres a readout of what i got, and a command to learn:
df stands for disk free, and it prints the space left on all your mounted drives.
the -h after the command is a tag, or command line parameter.
it stands for human-readable, and is responsible for the M and G representing mega and giga bytes.
most all programs on the command line can take tags like that, the - followed by a letter...
more on that when we get into linux.
$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hda2 296M 175M 106M 63% /
/dev/hda1 4.9G 4.8G 172M 97% /c
/dev/hda6 9.6G 1.6G 7.5G 18% /home
/dev/hda5 67G 18G 46G 28% /usr
/dev/hda7 9.6G 27M 9.0G 1% /var
the software choice: i like to keep it to a minimum.
services such as the telnet daemon telnetd...
a daemon is a process that runs invisibly in the background, waiting for input from a user.
such as telnetd, most daemon executable names end in d.
daemons are a security hazard. imagine, it tells your computer to listen for communication from the outside, and give appropriate responses.
so turn off telnetd, you probably dont need it. go through the list, turn off stuff you wont use. you can always get it from the disk later, or download it, or whatever.
you can always install new software on your system; that is its strength.
you are virtually guaranteed that a program will work for you if you download source.
be warned that the process is not always trivial...
most often, it consists of typing
./configure
make
make install
but when that doesnt work, you may need to change some options in the "Makefile" or maybe contact the author about the source.
some things may never work. for instance, svgalib on a ppc g3 wallstreet. just go hack on something else.
but all in all, i prefer source to rpms(which you can also use; they were designed to perform the same task).
i look for "tarballs", which are gzipped tar files.
tar is a utility which makes several files/folders into one file, and
gzip compresses files to save space and bandwidth.
a tarball is a compressed "image" of a whole directory tree containing source, docs, binaries, files, whatever you put in.
so pick out some choice software, make sure you got
emacs
gcc/g++
X windows (XFree86)
netscape (youll get used to the diluted web experience:)
gimp
ghostview for pdfs
and thats about all i need.
the installer will take a while, and reboot at the end.
lose the cd.
youll probably get a lilo prompt, or grub with redhat72. heres where you can choose which os to boot into.
you can save the default too, and set the amount of time it waits for input.
choose the linux kernel from the distribution, probably the only option.
hopefully, you will boot and watch the info scroll by on a curses/terminal/virtual framebuffer screen.
you know, full screen text mode, like old dos. this is called a virtual terminal, or the console.
linux has 6 of them built into your system, you can switch by holding control-alt and pressing f1 through f6.
ctrl-alt-f7 will display the current "x session" on your monitor if it is running.
an x session is like a desktop, or desktop workspace settings. whatever windows you have opened are all there (on more than one virtual desktop).
you can start an x session by typing startx at the console.
you can kill an x session by presing ctrl-alt-backspace.
login at the prompt with the username you specified. type your password.
you should be presented with a prompt. type 'ls' to list the files in your directory.
like other commands, ls can take tags.
try a few out:
-a all files, even "hidden" ones filename starts with a .
-l list format, print all files size and other info
-R recursive, list the contents of all directories listed, and so on.
ls -a
ls -l
single letter tags like these can also be combined:
ls -alR
now is a good time to get used to trying things. go ahead and type some commands.
some of the more useful ones are man and apropos. man is a manual page, and apropos searches the manual pages for a keyword.
try looking for information about mp3 on your system:
# apropos mp3
gtv (1) - MPEG audio (MP3) and video (MPEG-1) player with GTK+ GUI
MP3::Info (3pm) - Manipulate / fetch info from MP3 audio files
MPEG::MP3Info (3pm) - Manipulate / fetch info from MP3 audio files
plaympeg (1) - MPEG audio (MP3) and video (MPEG-1) player
# man plaympeg
the man command uses a program called less, its a stream reader. space to move forward a page, b to move back a page.
/string [return] to search forward in a document for "string", ?string for backwards.
you can read a file by typing
less filename.txt
and use the same commands.
if this is working, go to freshmeat.net and search for some free code to download.
grab the window manager blackbox from there.
edit your .xinitrc file (located in your home directory) to include the line 'exec blackbox'.
now when you start x again, your window manager should be blackbox(if you installed it already that is).
right click will bring up a menu of programs(edit this at /usr/share/Blackbox/menu).
i like to set my xterms to white on black; its easier on the eyes.
[exec] (xterm medium) {xterm -bg black -fg grey70 -geometry 100x40 -sl 500 -vb }
geometry specifies the size; this works for all x applications(names usually start with x)
-fg foreground -bg background
to compile c code:
open up a text editor, like emacs. i do all my coding in emacs, but i believe vi is the superior editor.
if you want to be really cool, id suggest learning it early. itll work well over a slow telnet, terminals of any type...
anyway, just save your source file in some directory where you can access it.
then type gcc filename.c (use g++ for c++).
you can give it the -o output tag to name the created executable. if you dont it will be called a.out.
now to execute it:
in every unix command, the first word is the executable. normally, the system searches when you type a command for a matching executable name.
it checks every directory listed in your "PATH". this "environment variable" path includes a list of directories where binaries are stored.
(these are usually directories called bin, /usr/bin, /usr/local/bin, etc.)
you shouldnt have . (the current directory is . parent is ..) in your path; it means you may execute the wrong executable.
say you type 'ls', but some joker has named a malicious executable 'ls' and hidden it in hid directory.
so you 'cd' (change directory) to his dir, run ls and execute his wack code. BAD.
so you manually put in the path to the executable by typing
./a.out
and your program will run, printing its output to your console and taking input from the keyboard.
you could have it take input from a file or another program by using "piping" with the | on the command line.
this is the next level.
you can type a command like find which prints every filename recursively.
you can pipe the output of that through a filter called grep so it only prints the lines that have the work blackbox in them
so with
find / | grep blackbox
you can locate every file related to blackbox on your system.
you can pipe anything into anything; this is the true power of computing.