LINUX INSTALLATION AND USE
This isn't really a tutorial, but rather bits and pieces of solutions to problems I've encountered with Linux so far.
Linux has become much easier to install and use, compared to just a few years ago. But be prepared to still sweat a bit if you're totally new to UNIX-like operating systems.
It will take you several hours longer to get linux installed and configured on your system than it would take you to install windows.
But what is a one time extra couple of hours, compared to the peace of mind and almost crash-proof operation that Linux gives you. What is more, you won't believe what programs you can get for free that run on Linux.
Take for instance Photoshop, which costs anything from $500 to thousands, has a free Linux look-alike called GIMP. Don't let the name fool you either. This puppy is a powerful graphics editor, with full support for plug-ins and extensions. Read the manual for guide and tutorials.
AVI-XMMS plugin (DivX,MPEG4 player), Quake 3 v1.11, LinuxCAD 3D release 2.0 (compatible with AutoCAD), Corel WordPerfect 8, gnapster 1.4.1a (yes, napster for linux), SimpleCDR 1.64,
gFTP 2.0.8, Video Server 0.5.2 (video streaming), Apache-Frontpage 1.3.20-4fp (did I hear free Microsoft Frontpage?), Pan 0.10.0.91 (newsreader, loosely based on Agent and Gravity), Star Office (Microsoft Office clone), Xmms (linux winamp), Home Electrical Device Control.
A very long list of equivalents to your favorite Windows programs.
Redhat Applications. See programs that are already bundled with the latest redhat linux.
This page lists Bioscience applications in Linux.
Install the xpdf package if you need a viewer for PDF files.
gv also does the same thing. Start it like this
# gv filename.pdf &
Of course Linux is not for everyone. If you work with sophisticated statiscal packages, or need specialized scientific applications, etc, then Linux may not be the way to go. However, more programs keep coming out almost weekly, so look around before you write Linux off. Check out http://linux-newbie.sunsite.dk/lnag_apps.html for links to linux application programs. http://freshmeat.net features new linux software. Linuxapps
http://www.redhat.com/support/hardware/index.html This document lists most of the hardware supported by Linux and helps you locate any necessary drivers.
Find out about your system under Windows: start/settings/control panel/system/device manager. Know the vendor and model number of each card in your machine; collect the IRQs and DMA channel numbers. You probably won't need this information -- but if it turns out you do, you'll need it very badly.
Under device manager,
- dbl click on cdrom and then under settings tab, see if DMA is checked
- do the same for your hard drives.
- Video Card. I have done several Linux installations, and the one single configuration step that's given me the most headache is getting a video card to work with X. X is the GUI generator under Linux, i.e. it takes linux from command line to graphical phase. So save yourself some headache, make sure your card is supported before you proceed. Check the hardware compatibility list above. If your card is not listed, find a forum, and ask in there if anybody has had any luck with your video card. A good forum is http://forums.zdnet.com/
- Find out the chipset it uses from the card's booklet or from the manufacturer's website.
- How much memory does the card have?
- Don't skip this step, or you might find out later that your installation is unsuccessful due to inadequate info. Take the time to gather them now.
- Note your hard drive types, are they IDE or SCSI?
- Note your modem name, most importantly, what COM port it's connected to.
- If your machine uses a modem which relies on software drivers for some of its functionality, you've probably got a Winmodem. Because they depend on Micro$oft Windows-based software to operate correctly, these types of modems don't function in Linux. There has been some recent development in this area, and a few winmodems now have linux drivers. Conexant/Rockwell modem HOWTO. If you've got a Software modem whose chipset is not made by Conexant or Rockwell then you should see the linmodem howto http://www.linuxdoc.org/HOWTO/Linmodem-HOWTO.html. Also see http://linmodems.org.
- The external modem works faster than the modem which is inside your computer
- Internal ISA modem is better than PCI modems. It's the exact opposite under Ms Windows.
- Don't use a Plug&Play modem. If you have it, set Plug&Play
options to off, and manually set up modem on free com port (read Plug&Play-HOWTO).
- Communication programs include aminicom, seyon, or wvdial (for PPP) and mgetty) for dial-in. Such communication programs require that you configure them although the default configuration they come with may only need a little tweaking.
Unfortunately the communication program doesn't locate the serial port. This "locating" is the low-level PnP configuring of the serial port: setting its IO address and IRQ in both the hardware and the driver. If you are lucky, this will happen automatically when you boot Linux. Setting these in the hardware was formerly done by jumpers and then running "setserial" but today it's done by "Plug-and-Play" software. You may still need "setserial".
But there's a serious problem: Linux (as of early 2001) is not a true Plug-and-Play operating system. http://www.ibiblio.org/mdw/HOWTO/Modem-HOWTO-6.html
- Plug the modem into a telephone line. Then configure a communication program such as minicom or a ppp program (such as wvdial). Set the serial port speed to a baud rate a few times higher than the bit rate of your modem. Tell it the full name of your serial port such as /dev/ttyS1. Set hardware flow control (RTS/CTS).
Minicom is the easiest to set up and to use to test your modem. But if you are lucky you may get ppp to work the first time and not need to bother with minicom. With minicom you may check to see if your modem is there (and ready to dial): Once you've set up minicom, type the command: AT, hit enter and you should see an "OK" response which comes direct from the modem.
- Serial Port: Locating the Serial Port: IO address, IRQs
For a serial port to work properly, it must have both an IRQ and an IO address. Without an IO address, it can't be located and will not work at all. Without an IRQ it will not work well.. Today IO address and IRQ are set by digital signals sent to the hardware and this is part of "Plug-and-Play (PnP).
The driver must also know both the IO address and IRQ so that it can locate the card. Modern drivers (kernel 2.4) determine this by PnP methods so one doesn't need to tell them (by using "setserial"). The driver uses PnP functions provided by Linux to determine what the IO and IRQ are and to set them if necessary. The driver also probes possible serial port addresses to see if there are any serial ports there. This works for the case of jumpers and sometimes works for a PnP port when the driver doesn't do PnP.
Locating the serial port by giving it an IRQ and IO address is low-level configuring. The "setserial" program is one way to tell the driver.
When Linux starts, some effort is made to detect and configure (low-level) a few serial ports. Exactly what happens depends on your BIOS, hardware, Linux distribution, etc. If the serial ports work OK, there may be no need for you to do any more low-level configuring. If you're having problems with the serial ports, then you may need to do low-level configuring.
For kernel 2.2+ you may be able to use more that 2 serial ports without doing any low-level configuring (setting the IRQ and IO address) by sharing interrupts. All PCI cards should support this but for ISA it only works for some hardware. Until the serial driver knows the correct IRQ and IO address, the port will not usually not work at all. In summary, the low-level configuring consists of enabling the device, giving it a name (ttyS2 for example) and putting two values (an IRQ number and IO address) into two places: the device driver (often by running "setserial" at boot-time); memory registers of the serial port hardware itself
What IRQs to choose?
The serial hardware often has only a limited number of IRQs. Also you don't want IRQ conflicts. So there may not be much of a choice. Your PC may normally come with ttyS0 and ttyS2 at IRQ 4, and ttyS1 and ttyS3 at IRQ 3. Looking at /proc/interrupts will show which IRQs are being used by programs currently running. You likely don't want to use one of these. Before IRQ 5 was used for sound cards, it was often used for a serial port.
Here is how Greg (original author of Serial-HOWTO) set his up in /etc/rc.d/rc.serial. rc.serial is a file (shell script) which runs at start-up (it may have a different name or location). For versions of "setserial" after 2.15 it's not always done this way anymore but this example does show the choice of IRQs.
/sbin/setserial /dev/ttyS0 irq 3 # my serial mouse
/sbin/setserial /dev/ttyS1 irq 4 # my Wyse dumb terminal
/sbin/setserial /dev/ttyS2 irq 5 # my Zoom modem
/sbin/setserial /dev/ttyS3 irq 9 # my USR modem
There is really no Right Thing to do when choosing interrupts. Try to find one that isn't being used by the motherboard, or any other boards. 2, 3, 4, 5, 7, 10, 11, 12 or 15 are possible choices. Note that IRQ 2 is the same as IRQ 9. You can call it either 2 or 9, the serial driver is very understanding. Make sure you don't use IRQs 1, 6, 8, 13 or 14! These are used by your motherboard. You will make her very unhappy by taking her IRQs. When you are done you might want to double-check /proc/interrupts when programs that use interrupts are being run and make sure there are no conflicts.
For the ISA bus you should try to use the default addresses shown below. PCI cards use different addresses so as not to conflict with ISA addresses. Here are the default addresses for commonly used serial ports on the ISA bus:
ttyS0 address 0x3f8,
ttyS1 address 0x2f8,
ttyS2 address 0x3e8,
ttyS3 address 0x2e8.
Set IO Address & IRQ in the hardware
A simple way to do this is to let a PnP BIOS know that you don't have a PnP OS and the BIOS will automatically do this each time you start.
When you start up a PC a PnP BIOS starts to do PnP (io-irq) configuring of hardware devices. It may do the job partially and turn the rest over to a PnP OS (which Linux is in some sense) or if thinks you don't have a PnP OS it may fully configure all the PnP devices but not configure the device drivers. This is what you want but it's not always easy to figure out exactly what the PnP BIOS has done.
But how do you find out what the BIOS has done so that you set up the device drivers with this info? Other ways of finding out Use lspci for the PCI bus or isapnp --dumpregs for the ISA bus.
Once you've set the IRQ and IO address in the hardware (or arranged for it to be done by PnP) you also need to insure that the "setserial" command is run each time you start Linux.
Configuring the Serial Driver (high-level) "stty" Minicom sets clocal automatically when it starts up so there is no problem. stty is something like setserial but it sets the speed (baud rate), hardware flow control, and other parameters of a serial port. Typing "stty -F /dev/ttyS2 -a" should show you how ttyS2 is configured.
Finding Your Modem
Before spending a lot of time deciding how to configure your modem, you first need to make sure it can be found and that AT-commands and the like can be sent to it. If this works you may then want to improve on the configuration. A winmodem may be hard to find and will not work under Linux. http://www.ibiblio.org/mdw/HOWTO/Modem-HOWTO-8.html
Where is my "init string" so I can modify it ?
This depends on your communication program (often a PPP program). If this is the latest version of Modem-HOWTO send me info for other cases.
Gnome: run pppsetup, wvdial: edit /etc/wvdial.conf, minicom: hit ^Ao (or possibly ALT-o), then select "Modem and Dialing"
What is setserial ?
setserial is a program which allows you to tell the device driver software the I/O address of the serial port, which interrupt (IRQ) is set in the port's hardware, what type of UART you have, etc. If you only have one or two built-in serial ports, they will usually get set up correctly without using setserial. Otherwise, if you add more serial ports (such as a modem card) you may need to deal with setserial. You can see a list of possible commands by just typing setserial with no arguments.
Prior to probing with "setserial", one may run the "scanport" command to check all possible ports in one scan. It makes crude guesses as to what is on some ports but doesn't determine the IRQ. But it's a fast first start. It may hang your PC but so far it's worked fine for me. With appropriate options, setserial can probe (at a given I/O address) for a serial port but you must guess the I/O address. If you ask it to probe for /dev/ttyS2 for example, it will only probe at the address it thinks ttyS2 is at (2F8). If you tell setserial that ttyS2 is at a different address, then it will probe at that address, etc.
The purpose of this is to see if there is a uart there, and if so, what its IRQ is. Use "setserial" mainly as a last resort as there are faster ways to attempt it such as wvdialconf to detect modems, looking at very early boot-time messages, or using pnpdump --dumpregs. To try to detect the physical hardware use for example :
setserial /dev/ttyS2 -v autoconfig
If the resulting message shows a uart type such as 16550A, then you're OK. If instead it shows "unknown" for the uart type, then there is supposedly no serial port at all at that I/O address. Some cheap serial ports don't identify themselves correctly so if you see "unknown" you still might have a serial port there.
What is isapnp ?
isapnp is a program to configure Plug-and-Play (PnP) devices on the ISA bus including internal modems. It comes in a package called "isapnptools" and includes another program, "pnpdump" which finds all your ISA PnP devices and shows you options for configuring them in a format which may be added to the PnP configuration file: /etc/isapnp.conf. It may also be used with the --dumpregs option to show the current IO address and IRQ of the modem's serial port. The isapnp command may be put into a startup file so that it runs each time you start the computer and thus will configure ISA PnP devices. It is able to do this even if your BIOS doesn't support PnP. See Plug-and-Play-HOWTO.
What is wvdialconf ?
wvdialconf will try to find which serial port (ttyS?) has a modem on it. It also creates a configuration program for the wvdial program. wvdial is used for simplified dialing out using the PPP protocol to an ISP. But you don't need to install PPP in order to use wvdialconf. It will only find modems which are not in use. It will also automatically devise a "suitable" init strings but sometimes gets it wrong. Since this command has no options, it's simple to use but you must give it the name of a file to put the init string (and other data) into. For example type: wvdialconf my_config_file_name.
Dialing Out with Minicom
Minicom comes with most Linux distributions. To configure it you should be the root user. Type "minicom -s" to configure.
To configure you have to supply a few basic items: the name of the serial port your modem is on such as /dev/ttyS2 and the speed such as 115200.
Now you are ready to dial. But first at the main screen you get after you first type "minicom" make sure there's a modem there by typing AT and then hit the key. It should display OK. If it doesn't something is wrong and there is no point of trying to dial.
My Modem is Physically There but Can't be Found
Your problem could be due to a winmodem.
There's a program that looks for modems on commonly used serial ports called "wvdialconf". Just type "wvdialconf ". >". It will create the new file as a configuration file but you don't need this file unless you are going to use "wvdial" for dialing.
If what you type is really getting thru to a modem, then the lack of response could be due to the modem being in "online data" mode where it can't accept any AT commands.
To fix this, send +++ to the modem to tell it to escape back to "command mode" from "online data mode".
My Serial Port is Physically There but Can't be Found
If a physical device (such as a modem) doesn't work at all it may mean that the device is not at the I/O address that setserial thinks it's at. It could also mean (for a PnP card) that is doesn't yet have an address. Thus it can't be found. For the PCI bus use lspci or scanpci. If it's an ISA bus PnP serial port, try "pnpdump --dumpregs"
"Cannot open /dev/ttyS?: Permission denied"
Check the file permissions on this port with "ls -l /dev/ttyS?"_ If you own the ttyS? then you need read and write permissions: crw with the c (Character device) in col. 1. It you don't own it then it should show rw- in cols. 8 & 9 which means that everyone has read and write permission on it. Use "chmod" to change permissions. There are more complicated ways to get access like belonging to a "group" that has group permission.
"lsof /dev/ttyS*" will list serial ports which are open.
"setserial" shows and sets the low-level hardware configuration of a port (what the driver thinks it is).
"stty" shows and sets the configuration of a port (except for that handled by "setserial").
"modemstat" or "statserial" will show the current state of various modem signal lines (such as DTR, CTS, etc.)
"irqtune" will give serial port interrupts higher priority to improve performance.
"hdparm" for hard-disk tuning may help some more.
"lspci" shows the actual IRQs, etc. of hardware on the PCI bus.
"pnpdump --dumpregs" shows the actual IRQs, etc. of hardware for PnP devices on the ISA bus.
Some "files" in the /proc tree (such as ioports, interrupts, and tty/driver/serial).
- What type of keyboard, 101/102 keys, etc.
- What type of mouse, AT, PS/2, 2-button, 3-button, scroll mouse...
- If you have a network card installed, what's the make?
- Name of your sound card
- Name and model of your monitor.
- Vertical refresh rate
- Horizontal refresh rate
- Maximum resolution
- Is your CD-Writer Supported?
- Do you have more than 64 MB or RAM?
- Do you have a Hewlett Packard product?
Booting from a cdrom
If you have an EIDE/ATAPI CDROM (normal these days), check your
machine's BIOS settings to see if it has the capability to boot from
CD-ROM. Most newer machines today can do this.
If yours is among them, change the settings so that the CD-ROM is
checked first. This is often in a 'BIOS FEATURES' submenu of the BIOS
Then insert the installation CD-ROM. Reboot. You're started.
Booting from a floppy disk
If your bios does not support booting from cdrom, and you don't have a boot floppy disk already, you can make one as follows:
Your cdrom should contain a folder named HOWTOS. Browse that folder for Installation-HOWTO. You will be exposed to a full detail about installation under different scenarios that I have not covered here.
- Go to a computer with DOS on it, and insert your Linux installation cdrom into the drive.
- Put an empty floppy into the floppy drive.
- change to your cdrom drive, and cd to dosutils
- type rawrite.exe. Press Enter.
- When asked to enter image source, type: ..\images\boot.img
- Enter a: as the target drive, and press Enter.
Now put this floppy disk into your a: drive and put the cd into the cdrom drive. Reboot your system. The installation process is self explanatory from this point on, and you shouldn't have trouble taking it to completion.
Post Installation Notes
Just a quick note about post-installation procedures.
- After a successful installation, you will be asked to remove floppy disk and press ENTER to restart. Remove any CD from the drive also.
- This step may not be necessary in the newer versions of Linux (i.e. creating a normal user). If that's the case, skip it. You will see the login prompt upon restart. Type root.
- Type in the root password you chose during installation
- Once logged in as root, create a non-root user. To do that, type useradd akindel. In this case, akindel will be the username. Press ENTER.
- To define a password for the new user, type passwd akindel.
- Type in a password twice when prompted.
- To login under the new username, first type "login" at the prompt.
- Type "akindel", and ENTER. Then enter the password.
- You should now see something like: [akindel@localhost akindel]$
- To change password for akindel, simply make sure you're logged in as akindel, then type "passwd". You don't need to include the name here. Type old and new password, and you're done.
The command su means substitute users. You shouldn't work as root all the time. You could make fatal mistakes that are irrecoverable. Instead create a non-root user account for yourself using the procedure above.
If you then need to do anything as root, use the "su" command to go from your current non-root account to root. So let's say you're logged in as akindel, you can become root by typing in su. You will be asked for root password.
Your prompt will change from [akindel@localhost akindel]$ to [root@localhost akindel]#.
Also su can be used to get into another user account. Just type su username. A password will be required for that account.
Only root can shutdown. So login as root, or use su command to get to root.
- "shutdown -h now" will shutdown (shutdown) the system immediately (now) and halt after shutdown (-h).
- "shutdown -r now" will shutdown (shutdown) the system immediately (now) and restart after shutdown (-r).
- "shutdown -r +15" will shutdown (shutdown) the system after 15 minutes (+15) and restart after shutdown (-r).
- To learn more, type man shutdown.
- Use ctrl-z to get out to the man pages.
X Window System
If you selected X-Window system during installation, you should be ready to go. To start X, do it one of two ways: manual, automatically at startup. Try manual first.
How to Quit X
- Login as non-root
- Enter "startx"
When you're done using X, you'll have to quit it.
- Load some programs, eg Netscape, and test X with it. If everything seems to work fine, then you're ready to start X automatically at startup.
- Use your mouse to click on Start/Exit Fvwm/Yes, Really Quit.
Starting X Automatically at bootup
- If you're still in X, get out of it to the command line
- Login as root
- Issue the command /sbin/telinit 5
- Login again as root. If the desktop appears, then your X system is working well.
- Start/Exit Fvwm/Yes, Really Quit.
- If the login screen reappears, you're in business.
- You now need to Edit the /etc/inittab file in order to configure X for auto startup at login.
- See page 92 of Redhat LINUX Installation guide 5.2
- See http://www.oreilly.com/catalog/runux3/chapter/ch10.html.
Unlike under Ms Windows, to use a drive under Linux, you have mount it first.
- To mount, use "mount /dev/device_name", eg mount /dev/cdrom.
- After mounting the device, use "cd /mnt/cdrom" to get into the device. Once you do this, the prompt should change from [root@localhost /root]# to [root@localhost cdrom]#
- Use "df" to see what file systems are currently mounted.
- In order to unmount it you have to have all file browsers and terminal windows accessing it closed or not in the /mnt/cdrom dir... otherwise it will report as being busy.
- When you try to unmount and it reports busy you can type lsof /mnt/cdrom, and it will list all files / programs accessing /mnt/cdrom preventing you from unmounting it.
- To unmount, use "umount /dev/device_name".
- Directory Listing: After mounting and doing cd, use "ls /mnt/drive_name/folder", eg. ls /mnt/cdrom/Redhat/Rpms. Note directory names are case sensitive. Use "| more" or "| less" to display page by page.
- Use cd \ to get back to root directory.
- [you@localhost you]$ pico /etc/filename
- You can use Ctrl-X to quit the file.
- To edit a file called temporary, you would type "vi temporary" and press ENTER.
- VI editor has two modes: command and insert. The command mode allows the entry of commands to manipulate text. The insert mode puts anything typed on the keyboard into the current file.
- VI starts out in command mode. To get into insert mode use a or i.
- See http://www.eng.hawaii.edu/Tutor/vi.html
- To get out of VI, you have to be in command mode. Hit the "Esc" key to enter command mode.
- To save your changes and exit out of VI use the ":wq" command. When in command mode, type ":wq" then press ENTER.
- To quit out of VI without saving changes, change to command mode, then type ":q!".
Open Netscape and log onto http://localhost. If no errors, then Apache is up and running.
- Default page is /home/httpd/html/index.html.
- All cgi programs, icons and html pages are stored in /home/httpd
- To change location of web files, edit Apache config files in /etc/httpd/conf/.
- Logs of all httpd activity are kept in /var/log/httpd/.
Preparing your linux box for the Internet
Also at http://localhost/linux-security.html
Recommend - the many resources available on http://www.linuxsecurity.com/docs/HOWTO/MindTerm-SSH-HOWTO/index.html, www.sans.org, www.securityfocus.com, or www.securityportal.com for tutorials on how to secure your computers and servers.
To remove LILO
Changing schemes under genome
Don't see a theme you like in genom? You can find more themes at gtk.themes.org,
To install a theme,
GIMP example design
download a theme from the website
- select the Install new theme button.
- In the dialog which opens, scroll to the name of the file you downloaded (which will probably be in your login directory, named something
- Left-click on the file name, then click the OK button.
- Your new theme will appear in the Available Themes section.
on the Linux Documentation cd, browse to
Linuxconf in X
Login as root to use Linuxconf. You can either login as root or become root in your user
account. To accomplish the latter, open an Xterm and type su, then your root password.
Once you're root, type linuxconf to begin.
on the Linux Documentation cd, see /RH-DOCS/rhl-gsg-en-7.0/ch-rpmlite.html
You must be root. Because RPM makes changes to your system, for most functions you must be root in order to use RPM from either the shell prompt or through Gnome-RPM.
Changing to Root
Changing to root can be easily accomplished from within your user account.
You can temporarily switch from your user account to root by using the su command. Once you're
root, you can install, delete and work with packages and perform maintenance on system files.
Remember, however, that when you're root you can inadvertently damage your system, so use
Just type su at the shell prompt. You'll see something like this: [you@localhost you]$su
Type your root password
Now that you're root, you can start Gnome-RPM or perform your RPM command from the shell prompt.
To start Gnome-RPM from the Panel, go to the Main Menu Button => System => Gnome-RPM.
To start Gnome-RPM from the shell prompt, type gnorpm
The Shell Prompt
Overview, with examples, of Linux commands at the prompt. On the Linux Documentation cd, browse to /RH-DOCS/rhl-gsg-en-7.0/p6631.html
Ownership and Permissions
Locating (finding, searching) Files and Directories
You can use locate or find to search by keyword in linux.
find / -name "searchterm"
Note: replace searchterm with the word you're searching for.
With locate, you'll see every related file or directory which matches your search criterion. Let's say we want to search for all files related to the finger command.
Choosing more than one resolution for your monitor
When using Xconfigurator, you can select more than one screen resolution -- for example, if you prefer 800x600 and 1024x768, you can adjust your resolution "on the fly." To do this, use the Ctrl-Alt-+ (plus) or Ctrl-Alt-- (minus) keys.
See linux 7 cdrom, RH-DOCS/rhl-gsg-en-7.0/s1-q-and-a-xconfig.html
An Introduction to Linuxconf - Creating a New Account in Linuxconf
Hard Disk Space
To check the space use the df (="disk free") command:
Star Office is a very complete office suite: word processor, spreadsheet, presentation program, drawing program, html editor. Full version of Star Office is available for free for both Linux and MS Windows--at http://www.stardivision.com/freeoffice/ (large, ~100 MB download).
Star Office looks and acts very much like MS Office for Windows. This includes richness of features, large size, but very slow startup. The trick is to have plenty of physical memory, the more the better. It has a very good file-level compatibility with MS Office: read and write MS Word, MS Excel and MS PowerPoint file formats. The StarOffice word processor is faster and feels better than WordPerfect for Linux.
The installation of StarOffice is confusing and it goes like this:
At minimum, you need some 350 MB of free disk space (of which, ~100 MB you can release after installation).
SIMPLIFYING LONG COMMANDS WITH ALIASES
To simplify writing long commands, you may define a global alias by placing a line in the file /etc/bashrc. Here's an example:
Decompress the downloaded file. You can do it as root in the /usr/local directory for "local server" installation, but you may choose /home/your_login for "personal" installation:
- cd /usr/local
- tar -xvf StarOffice5.2.tgz
- As root, run the setup program for a "local server" with the DOS-style /net switch:
- cd Office52
- ./setup /net
- [Without the /net switch, StarOffice will perform a personal installation (into your home directory), and then only one user will be able to run it.]
- After this "network" installation, each user has to perform her/his own installation to put some personal files into their "home" directories (by running program/setup as a user, without the /net switch).
- StarOffice will insert a menu item into your "K-menu"-"Personal"-"StarOffice 5.2".
- To run it from the command line, use:
alias cdrecord="cdrecord -v speed=2 dev=1,0,0"
Re-login for the changes in /etc/bashrc to take effect. After creating this alias, anytime you issue the command cdrecord, it's replaced automatically by cdrecord -v speed=2 dev=1,0,0.
This is a good resource for beginners http://sunsite.dk/linux-newbie/.
Change the linux kernel version.
Searching MAN pages
- To get info about a term, type man term. Of course, replace term with the actual word. E.g. man apache.
- Use the Space bar to move forward through this document a "page" at a time; use the B key to move back, and use the Q key to quit
- To get a page at a time, use "less term"
- To get out of "man" or "less", Press ESC twice, then press q.
You can also search man pages for strings instead of commands.
Before you can do such a search, you need to first create a database called makewhatis.
This takes several hours to create, so you need to run the linux box overnight. Issue the command /etc/cron.weekly/makewhatis.cron, and let it run overnight.
Once the database has been created, you can then use man -k string_to_search_for.
Every package containing documentation places their documentation in a subdirectory of /usr/doc. They can be viewed with more filename or less filename.
For example, you see a package called rtin in /usr/bin/rtin, and you would like to know what that package is about, just enter
rpm -qdf /usr/bin/rtin
If you have X already running, you can use Netscape to view them. Just start netscape and type the path of the doc you want to view into the Location: window.
HOWTO, HOW-TO List of howtos
http://www.ibiblio.org/mdw/HOWTO/Online-Troubleshooting-HOWTO/index.html - This document will direct Linux users to resources available on the Internet that provide access to a vast amount of Linux-related information useful in troubleshooting problems.
This HOWTO contains those hard to find hints and tweekings that make Linux a bit nicer.
Plug n Play
Sometimes when trying run a program, you get a segmentation fault ?
This is caused by your computer trying to get Plug-and-Play to work with your program. You can stop it doing this by going to your BIOS and setting an option which tells it not to do that. The settings name varies from BIOS to BIOS but is normally something like PnP OS.
My desktop PC is fitted with an old Sound Blaster 16; even if you've got something different, you may take what follows as guidelines.
I compiled the sound card support as a module (sb.o). Then I put this in /etc/conf.modules:
options sb io=0x220 irq=5 dma=1 dma16=5 mpu_io=0x330
alias sound sb
To enable the sound, make sure that modprobe sound is invoked in /etc/rc.d/rc.sysinit. Alternatively, get the tool sndconfig from the RedHat site.
Besides the standard kernel sound drivers, the Alsa drivers ( ) are an excellent choice. Strangely, though, the sound channels are muted by default. You'll want to use aumix and this /etc/aumixrc to set the volume to 100%:
Issuing the command hostname new_host_name may not be enough. To avoid the dreaded sendmail lock, follow these steps (only valid for a stand--alone machine):
edit /etc/sysconfig/network and change the hostname therein (e.g. new_host_name.your_domain);
- edit /etc/HOSTNAME appropriately;
- append the new hostname in the line in /etc/hosts:
- 127.0.0.1 localhost new_host_name.your_domain
It's handy to have mount points for the floppy, other devices and NFS-exported directories. For example, you can do the following:
~# cd /mnt; mkdir floppy cdrom win zip server
This creates mount points for a DOS/Win floppy, the CD--ROM, the Windows partition, the parallel port Zip drive, and an NFS directory.
Now edit the file /etc/fstab and add the following entries:
/dev/fd0 /mnt/floppy auto user,noauto 0 1
/dev/cdrom /mnt/cdrom iso9660 ro,user,noauto 0 1
/dev/zip /mnt/zip vfat user,noauto,exec 0 1
/dev/hda1 /mnt/win vfat user,noauto 0 1
server:/export /mnt/server nfs defaults
Obviously, you must use the correct device in the first field.
Note the `auto' filesystem type in the first line; it allows you to mount both ext2 and vfat (DOS/Windows) floppies, but you need a recent version of mount. You may find mtools more convenient.
2.14 Automount Points
If you don't like the mounting/unmounting thing, consider using autofs(5). You tell the autofs daemon what to automount and where starting with a file, /etc/auto.master. Its structure is simple:
In this example you tell autofs to automount media in /misc and /mnt, while the mountpoints are specified in /etc/auto.misc and /etc/auto.mnt. An example of /etc/auto.misc:
# an NFS export
server -ro my.buddy.net:/pub/export
# removable media
cdrom -fstype=iso9660,ro :/dev/hdb
floppy -fstype=auto :/dev/fd0
Start the automounter. From now on, whenever you try to access the inexistent mount point /misc/cdrom, il will be created and the CD-ROM will be mounted.
Common Administration Tasks
Network Configuration, Restricting Network Access ...
Recent versions of XFree86 (say, > 3.3.4) use an X Font Server that supports PostScript Type 1 and True Type fonts natively, so you can use the wealth of fonts available on the net. There's a simple procedure to follow.
Suppose that you download a Type 1 font collection, e.g. Freefont ( ). To make it visible to the font server, unpack the archive from /usr/X11R6/lib/X11/fonts/. Then edit /etc/X11/fs/config, add an entry for the new directory, and restart the font server.
If you're rolling your own font collection, you'll need to supply the files fonts.dir and fonts.scale; the tool to make them is type1inst, available from .
As for the True Type fonts, group them in a directory of your choice and create fonts.dir using ttmkfdir > fonts.dir, included in the Freetype archive; . Then proceed as above. For example, if you want to use the Windows fonts you have in, say, /mnt/win/windows/fonts, go to that directory, run ttmkfdir, edit /etc/X11/fs/config and restart the font server.
It all started from the original True Type X font server: .
Configuration HOWTO http://www.ibiblio.org/mdw/HOWTO/Config-HOWTO.html
DOSEMU-HOWTO http://www.ibiblio.org/mdw/HOWTO/DOSEMU-HOWTO.html, The dosemu HOWTO
DOSEMU stands for DOS Emulation, and is an application that enables the Linux OS to run many DOS programs.
boot-time messages use dmesg to see them or shift-page-up after they have flashed by.
How to find out what process is eating the most memory.
ps -aux | sort +4n
Why does sendmail hang for 5 minutes on startup with RedHat?
This is a fairly common problem, almost to the point of being a FAQ. I don't know if RedHat has fixed this bug in their distribution, but you can repair it yourself. If you look in your /etc/hosts file, you will find it looks something like:
127.0.0.1 localhost yourbox
When sendmail starts, it does a lookup on your hostname(in this example, yourbox). It then finds that the IP for yourbox is 127.0.0.1, sendmail doesn't like this, so it does the lookup again. It continues with this for a while until it eventually gives up and exits. Fixing the problem is extremely easy, edit your /etc/hosts file and change it to something like this:
Public Web Browser mini-HOWTO Describes the setup of Internet kiosk-type system based on Linux to be deployed to provide public Internet/webmail access. The basic idea here is to give web access to people who wander by, while limiting their ability to mess anything up.
Achieved with the chmod command on either a file or directory. Permissions can be changed for Owner, Group, Everybody else. The three types of permission that can be changed are r for read, w for write, and x for execute. r = 4, w =2, x = 1. 0 Means no permissions given.
The syntax is as follows:
chmod Owner(r+w+x)Group(r+w+x)Everybody(r+w+x) filename
Therefore, to give read, write, and execute permissions to the owner of the file some_file, and no permissions to anyone else,
chmod 700 some_file
This is 700 because for the owner, you have 4+2+1 = 7. For both group and everybody, 0 = no permissions.
An image should be r,w for owner, and read-only for group, everybody. So for img.gif, we get
chmod 644 img.gif
Backup To backup your system use the program dump.
If you use a desktop environment like GNOME you can use these images to spruce up your background.
How Do I Resize a Partition (Non-Destructively)?
Use the FIPS.EXE program, included with most Linux distributions.
Services: off and on
Run /usr/sbin/ntsysv probably as root. When you run this script, you get a menu for turning services off/on. These services are entries in /etc/rc.d/init.d file.
Is There a Defragmenter for Ext2fs, Etc.?
Yes. There is defrag, a Linux file system defragmenter for ext2, Minix, and old-style ext file systems. It is available at ftp://metalab.unc.edu/pub/Linux/system/filesystems/defrag-0.70.tar.gz Users of the ext2 file system can probably do without defrag, because ext2 contains extra code to keep fragmentation reduced even in very full file systems. See http://email@example.com/msg17753.html
How Do I Install tar.gz Software?
On a correctly configured system, installing a GNU software package requires four steps:
- With the source.tar.gz archive in the /usr/src/ directory, or wherever you maintain your source files, untar and decompress the package with the command:
tar zxvf package-name.tar.gz
- Run the ./configure script in the untarred source archive's top-level directory with whatever command line arguments you need. The options that configure recognizes are usually contained in a file called INSTALL or README.
- Run make. This will build the source code into an executable program (or programs) and may take a few minutes or a few hours, depending on the speed of the computer and the size of the package.
- Run make install. This will install the compiled binaries, configuration files, and any libraries in the appropriate directories.
I Want to Use Linux with My Cable Modem.
The www.CablemodemInfo.com and xDSL Web page at has a section devoted to Linux.
You can tell how much memory and swap you're using with the free command, or by typing:
What Version of Linux and What Machine Name Am I Using?
Xconfigurator under linux had problems. So I used Xinstall.sh to find my version of linux and glib. Command is:
sh Xinstall.sh =check
Knowing the versions, I now downloaded the correct files from ftp.xfree86.org