Linux as server

My Sme7 howto's-

Linux commands

Get to Know Linux

Old stuff

Just pretty photos

My Linux and other resourses

I have began tinkering with linux in spring 1999. Since learning linux can be a drag I thought why not write some things down and share it on the net. This is what these pages are about.

On these pages you can find some linux commands, links for newbies and some tips and hints. Beside that the iptables howto for more advanced users.

In the beginning I have written some howtos for the really newbies. There are old howtos on Caldera 2.3 as a gateway a project to use e-smith server (a redhat 6.1; 7.2 in 2002 server system) as gateway for mxstream in the netherlands, which I am still using today although now version 5.x.

Since then I wrote an iptables howto, some reviews of linux e-mail servers for linux journal and a bluetooth for linux howto. I am hoping to start work on a system-admin's overview for linux soon.

Have fun!

When linux is better

Windows users often do not know why windows would be worse than linux. My stance in this is non-religious in nature: sometimes windows is better, sometimes linux. It depends on your needs. There are also the bsd's, but I consider them geek-based (you need to know a lot to use it).

Windows is still better for gaming, although this is shifting a tiny bit. Linux does not have photoshop support yet, and there are some other programs missing as well. Also some things are not yet well-integrated yet: (some usb-hardware and so on.) A lot of programs are available on linux, see this

If you only use your pc for internet and writing in word and emailing, linux is as good as, and thus better than windows.

Why is linux better then? Well, it is more secure than any windows-version (because user-rights are better managed for instance). There are virtually no viruses (don't believe the hype on internet: linux is still virus-free, although there are some worms attacking server-processes like webservers). Microsoft never told you that, did they?

Linux has more possible and better (journaling) file-systems (you care when the power fails; no more waiting for 30 minutes while scanning the disk after a power-failure), it has a vastly superior firewall support (iptables), uses less system resources (you need not buy a new computer with every version change), and the commandline is is extremely powerfull. You can kill all processes without crashing the machine. You can use dozens of window-managers (non-existing in wondows). These are all advantages when you are are not a geek. It is of course also less expensive.

Most software is free and also good. You can use open-office in stead of word, you can use opera and mozilla to browse, opera/kmail to email and so on. With mindi and mondo you can make resque-cd's that full-automatically re-install your system form scratch (save the data though!). If you do become a real linux-power-user you will see the real power: you can make things as you want. If you do not understand something, you can find out how it works by reading stuff and searching your hard-disks' config files. The commandline is awesomly powerfull.

Links for the newbie

what programs in linux can replace your windows programs?

Linuxtoday to read about what is going on.

oreilly's devcentre with all kinds of howtos articles and so on.

sysadmin. Many nice tutorials, many difficult

Ibm developerworks. More nice tutorials.

Questions and answers for all kinds of stuff. This link is usefull when you are allready ok with using linux, but want to change a specific script.

general advanced stuff for newbies. shellscript and so on. home of the really usefull Newbieized Help Files (NHF). This site is really usefull. Go to the NHF section or to the huge chat section. You can get serious help here. Better than on the usenet. get your new programs here or find out what is available.

Linuxplanet tutorials

Tucows for programmes with linux

Vmware spend 99 dollars and run windows 98 or 95 or nt on your linuxcomputer without rebooting linux. Of course you must reboot windows lots of times. Simply very nice when your colleques all use words 97 and so on. Not good for games though.

Linux care with their support pages. Lots of tips from real users.

Howtos you really need to read before tinkering or when tinkering.

Configurartion howto when you want to change for instance some commands that are too long. Use the alias trick.

Networking set up your ip address and so on.

Kernel compilation. You want a faster pc? Give it a try.

Samba. When sharing files with windhoze computers you need this. Especially when something goes wrong they have a good troubleshooting paper.

Getting system information

The Linux System Administrators' Guide Get the big picture on all those strangedirectories.

The Network Administrators' Guide wanna run a webserver and so on? Read this.

Globbing on the command line. Telling you how to use find / * /[wreoe] and so on. It helps!

The Linux commands you need!

After half a year of linux, I have some post-it memo's sticked to my monitor with some commands that are really usefull, but that I keep forgetting (I forget a lot, that is why I write it down. Unlike people that think they are really cool because they can remember everything, I tend to think that all the great new impressions I get just need so much room, they push out others).

Right commands; there we go.. NEW some of these things have been stolen from

What processes are running? ps waux | more The processes with k are kernel processes usually.
How is the load of your machine? vmstat 5 . The idle time is important . If this is 0 for long you might just have a problem. uptime also shows the load. Also try iostat, free, top.

Own your processes
have a good look at man ps to see what you can do. Nice are "ps wax" "ps waux" ps wauxwww" and so on.
Monitor what is going on by doing tail -f /var/log/messages . And you will see what logging is being produced.
Look at what files are open by using lsof . lsof -i for network, lsof -ujoe for all files for user joe and so on.

Own your disk
See where your diskspace is going with goign to / and doing du -s *. Then cd to the biggest space-eater and repeat this there and so on.
sort files by age with ls -lt. By size with ls -lSr . See man ls.

Own your network
look at your routes with netstat -r | more
Look at your interface with ifconfig
Look at open ports and so on with netstat -an or lsof -i
Look at interfaces with netstat -i eth0

alt-F2 and alt-F1 lets you switch between virtual consoles . Actually alt-Fn, where Fn is one of the function keys F1-F6. (If you are in X, you'll probably need to use Ctrl-Alt-Fn instead.) Alt+F7 gets you back to your X session, if one is running. You can rotate between consoles with the Alt-right arrow and Alt-left arrow key combinations. In this way you can kill a process in console two that has console 1 blocked.

locate lets you use an easier way to find files than the find command. In contrast to find's complexity, locate is the ultimate in simplicity. The command:


searches an internal database and prints the pathnames of all files and directories that contain the given string in their names. You can narrow down the search by piping the output to grep. For example, the following finds all files containing the string "kde" that are in bin directories:

locate kde | grep bin

The strings don't have to be complete names; they can be partial strings, such as "gno" instead of spelling out "gnome". The -r option lets you use a regular expression (in quotes):

locate -r 'gno*'

One thing to be aware of is that locate is case-sensitive: Searching for HOWTO and for howto will give you different results.

Rather than searching the disk each time, as find does, locate depends on the creation and maintenance of a database. Because it only has to search the database, not the disk, locate is faster than find. On the other hand, the results are only as current as the database.

The locate database is generally updated daily by a cron job, but you can update it manually by running the command updatedb (usually as root). If you are adding new applications or deleting old files and you don't want to wait for the next day to have an up-to-date database, you might want to run it manually.

If you want to use find however, to find a file crontab in /etc do :

find /etc -name crontab

find /etc -name cron*

tab will complete the prompt command for you, like url's in netscape and IE. So do /etc/-TAB- and you will get that file you also wanted before. Another tab and you will get the next one.

dmesg gets you to view startup messages . The dmesg command provides an easier way to see the boot messages than trying to read them before they scroll off the screen. When Linux boots, the kernel startup messages are captured in a buffer known as the kernel ring buffer; dmesg prints the contents of that buffer.

uname lets you find out what kernel version you are using. Do you ever need to know what version of the Linux kernel is running on your system? You can find out with the uname command, which prints information about the system. Issued with the -r option, uname prints the kernel version:

% uname -r


Other uname options provide information such as the machine type, the name of the operating system, and the processor. The --all option prints all the available information.

cntr-W (or ^W) lets you delete the complete command at the shell prompt. At this link you can find more of these tips. Most important:

^w erase word

^u erase from here to beginning of the line (I use this ALL the time.)

^a move the cursor to the beginning of the line

^e move the curor to the end of the line

!xyz lets you search the command history for commands with xyz as the beginning.

!xyz:p will show the command that would be executed rather than executing it.

!$ will repeat the last word of the last prompt command.So if you do pico /etc/ppp/ip-up and then pico !$ you will get the same result: the !$ expands to the last word of the last command so in this case to /etc/ppp/ip-up.

chkconfig will show you what programs and so on start at what runlevel with a redhat system. You can use chkconfig --list --add --del --level. With the delete you can het rid of those pesky deamons you don't need. Like pcmia when you do not have a laptop. Have a look at ask the geek 2 and here where it is all explained.

ifconfig gets you your ip number and so on, as well as the ip number of the gateway from your isp (internet provider you are dialing into are are hooked upto).

w Tells you who is logged in.

find /etc *.jpg This tries to find anything ending on jpg (pics) in the directory /etc and every subdirectory in /etc. You can change /etc and *.Jpg of course :-) Do man find to find out more.

crontab can be used to schedule things. first do

export VISUAL=pico

to make sure you can use the editro pico instead off the legacy-mistake shit editor VI (my opinion).
Then do
crontab -e
and you will see a temporary file where you can add commands. See man crontab and man cron for more.

The command
10 * * * * /etc/rc.d/init.d/adsl check
will schedule the command adsl check every 10 minutes. The * * are minutes; hours days months years I believe. Check out linuxnewbie
. for more on this.

rpm stuff RPM lets you install and uninstall programs without compiling them . There are the essentials when doing this from the command prompt:
# rpm -q bc
asks the rpm manager if package bc is installed.

# rpm -e bc
uninstalls bc
-e means erase

# rpm -ihv bc-*.rpm
installs the package bc-......rpm
-i means install. H means show this ############# when installing
-v means verbose or in linux language give some info while youre busy.
So if you have a package cpp- at /var/rpms you can install it by doing
rpm -ihv /var/rpms/cpp*.rpm
but you are better of to use (exept for kernells)
# rpm -Uvh /var/rpms/cpp*.rpm because this updates rather then installs. This is nice because if there is an old version the old stuff gets erased if you do not need it. also see here

df This tells you how much room you have on your linux disk partitions. Man df tells you more.

du This tells you how much diskspace is taken up by the directory you are standing in and the subdirectories when giving the command. To change directories do cd ..(to go up) and cd /etc to go for instance from root (/ ) to /etc. You can also do cd /etc/rc.d/ from anywhere.

netcfg This tells you how your routing table is doing, and what is in it.

whereis mam Tells you where the directory or file mam is.

whatis mam Tells you what mama is? A psychiater can tell you more as well as man whatis

which mam Forgot this one.

top Tells you things about memory status

ps ax Tells you what processe are running. Do man ps to find out more.

kill 1234 stops process 1234. Don't do this with process 1! 'ps ax' tells you what numbers processes have.

man ps > /tmp/manps.txt Writes a file 'manps.txt' or any other name you choose, with in that file what you see on screen when you do 'man ps' or any other command.

lpq Tells you what is in the printing que

lprm Cancel a print

Howto make a back up of say your /etc directory? Have you tried to read man tar? Boehoehoe!!!!! This is exactly why linux was not for common computer users. This kind of things really piss me of to a great extend. I would like those that wrote this man to go to hell and stay there. (sorry but I get really angry by such unreadable documents, without even a gew examples to explain how to do what a common personwould do with it).
So you want to backup /etc and all in it to /tmp huh? (thanks to Joe Burns from html goodies).
First you have to make a /tmp directory of course where you can write to. mdir /tmp or use your filebrowser. The rights have to be so that you can write to it as root, and read it as non-root. Be carefull because /etc contains your passwords. If anyone can go to the directory and read it then they can get to your passwords.
To back up do
tar cf /tmp/backup.tar /etc
tar means tape archive and that is based on those days when you did not toast everything on cd. Or when your cd's are not big enough because you need to back up all the home directories of an entire organization like Intell :-)
c = create, f = targetfile, /etc = what you backup
If you want to compress it do tar czf /tmp/backup.tgz /etc
compressing is not that cool because if there is one mistake in the file it will be useless. So only compress if you need the space or if you got a lot to tar.
If you want to see what is going on do ' tar cvf /tmp/backup.tar /etc '
Test it by doing tar tf backup.tar
Unpack it by doing ' tar xf backup.tar ' STOP! Dont do this when you are in '/ ' because you will overwrite your original '/etc ' !!!!!!!!!
Or if you also zipped it ' tar xzf backup.tgz '.
STOP! Dont do this when you are in / because you will overwrite your original '/etc' !!!!!!!!!

Something on directories and rights and viruses


-Why working as root is stupid!-

In windows 98 and so on anyone can read any directory. Not so in linux. When you are root, it is like windows 98, but when you are a common user you can only get to a few directories.

"What the heck !!!" you will say; "Who cares!"

Well you do!

If you know that not working as root prevents you system from being accessed by the boy next door and 5 million of his friends when you are on internet, and that this prevents viruses. Have you noticed there are almost no virus scanners for linux? There is no need! --->> IF YOU DONT WORK AS ROOT.

How come? In linux root and the system have their own programs, and the users have their own programs. They are in different directories. As a user you can print, but you cannot change the program that prints, and how that program runs.


In windows you can get a computer-virus as a user. When you run the program or disk with a virus it spreads to other programs. In linux, a virus can only spread to other programs you have acces to. And you don't have acces to others' programs and the system programs, so the virus cannot spread.

THIS IS WHY you should not work as root.

Only work as root if you back up stuff, and if you change the configuration of the system; ie when you add hardware and so on. If you surf the net, and use wordperfect or another text editor, run as a user!

You can use the su command (do 'man su') to become root if you need to.

Two security tips.

TIP 1. The security in linux goes down the drain if you give users acces to any files root can run !!.
Also text files, since amongst those 'innocent files' are scripts; and scripts have the power to delete your drive, blow up our planet, and kill the neighbour (OK exaggerating). Scripts in linux are text files that are coupled to programs, and these can do anything.

So if you make directories where root saves things, and other users can write to that directory, you are throwing away all security!!

So if the boy next door or one of his 5 million friends get access to your system over the internet (or directly because you let them surf on your machine even with a normal account) and they replace a file in your unsecure directory, which you as root then run thinking it is your saved script.............

Then you are hacked!!

Now you say, 'ok I wont do that.' Good! But you do this without knowing so if you are not careful.

Tip 2: Remember this: when you are root, do not copy important information or system files to directories you do not own.

A directory in Linux has a lot of security info attached to it: who can read it, write to it and so on. But also something called 'suid'. Look in your filemanager to the properties of a directory (probably click with the right mouse button on the directory and look at 'properties'). In Caldera you can go to the tab permissions and there you can click on suid, sgid and sticky. When you set the suid bit on a directory not owned by root, and you copy something to it as root, the file you copied will get the user security the directoy has. Sounds complicated?

If you copy your passwordfile, or a backup containing passwords or other security stuff, to the directory of a user there is the possibility he can read it and execute it. Normally the files you copy as root will be only readable and writable to root. This changes when the directory you copy something to has the suid bit set: then your files are compromised.

The linux Router Project

How to use one little floppy disk to make your 486 or old pentium (even without hardisk) a router or gateway.

This is meant to be a NHF or Newbieized Help File, so that all that are newbie and proud of it can read and understand it.

Until the NHF is ready only links to resources will be posted here.

I have most of the text i will be working on on another working page here.

How to get your linux desktop in your windows computer.

This howto is a bit old. These days kde comes with vnc. This howto explains some things I that you need to do to install by hand. I am referring to a tool called VNC: Virtual Network Computer. It can be used to acces the desktop from computers, windows and linux, over a tcp/ip network. That can be an internal lan or the internet: as long as you can refer to a computer by an ip-number. To use it to acces a windows computer is very easy: just run winvnc (get it at the url above) and run it. Then you must enter a password and you are finished (in a positive way that is;-)). You can access the computer from a webbrowser (with java support., so netscape and internet explorer version 4 and up) by typing There you are! Of course must be changed by your ip number. It is not very fast, but over a lan it will do just fine. Over the internet you are not very secure, but you can do all kinds of stuff by using either vpn or a ssh channel. How to do some of that is explained at the url above. The vnc server just uses standart tcp/ip http post, so a standard firewall will let you through (also hackers of course).

Now if you want to run it on linux there is more to it. You must install and run it just like in windows (well not just like.., read the manuals). But to see the gra phical screen you must make sure that you also call the window manager stuff and so on; i.e. kde or gnome or whatever you use.

On my caldera box I installed it as root of course, since I want to log on as root. This is not that compromizing since I have a firewall rule to keep others from my 5801 tcp/ip port and I always log out on the linux box before I disconnect vnc.

How to set it up with kde? (if you use kde 3+ it might already be there.) . In my root directory is the hidden directory .vnc. In that directory is the file xstartup. Remember this is for Caldera 2.3! This file sais:
#!bin/sh startkde & ;; *) xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" & twm&

That is it. The vncserver script is in /etc/rc.d. I run it and I can startup the connection! The linux box has no monitor nor keypad attached whatsoever. It is just a box sitting on a shelve with some wires to it.

Not much for a howto, but it works for me!

Linux desktop on your windows computer over SSH.

februari 2002

vnc over ssh howto: from linux to windows

What I want to do is control my linux x-desktop on my windows workstation. But I want to do this securely over the internet. I can do this many ways, but running vnc over ssh is one.
with ssh we can built a secure tunnel, and if we tunnel vnc over it I can have my linux desktop at home on my work within a browser. You can also do it form windows to linux, but that is more difficult. I assume you have redhat 7.2.

First you will need ssh installed. If you installed redhat server you will have it, if you don't have it installed redhat leaves you doomed. There are so many dependensies you better reinstall. If you have suse you can just let yast sort out the dependencies between software rpm's. Make sure the ssh-server is running. If you use the latest from you can both use ssh-1 and ssh-2 (important!). ssh-1 and 2 are different ways to encrypt data and so on, and ssh-2 is generally safer and better.

Second: we will use tightvnc from tightvnc since I will use it over the internet and it is faster than normal vnc.
Download the three rpm's: [viewer, i386] (96,693 bytes); [server, i386] (698,809 bytes); [docs] (1,086,112 bytes). Source is not needed. Install them by doing
rpm -ivh vnc-3.3.3r2+tight1.2.2-1.i386.rpm
rpm -ivh vnc-server-3.3.3r2+tight1.2.2-1.i386.rpm
rpm -ivh vnc-doc-3.3.3r2+tight1.2.2-1.i386.rpm

If you have problems you probably have vnc inbstalled. uninstall it with rpm -e vnc.....rpm. You will have to uninstall it twice: for server and viewer. You can also just use vnc.

Now run "vncserver". Give a password. Now in your home directory there is .vnc with the file .vnc/xstartup. You can modify the line twm&; to startkde& ; to get kde to start up in stead of twm; a minimal windowsmanager.
Now connect to the ipnumber your linuxstation has in netscape 6. ""

And you can log in. You can even send cntr-alt-delete and type startkde and see kde restart. Cool, huh. Nice if you have re-set some of the options while getting the connection without flaws: in my case some of the desktop did nor refresh right, so i needed to tweak some things.

If this works we can move on to ssh.
As a ssh-client for windows you can use putty: free and better than all. The site is at: or at
The newest version can do ssh tunnels.
So install it and run putty.
Configure putty:
In the left category bit, go to connections->ssh_>tunnels
1. add new local port: source port is 5801 (or any other you like). The source port is the port you can locally connect to; this port will be forwarded via ssh to the linux station running vnc.
2. Destinationport is the ip of the linuxmachine and the port of vnc.
Now 3. do the same for port 5901 on the linux box: source port is 5901, destinationport is (your ipaddress of course.)

Under session put port 5801 (or any other you gave as source port).
On the ssh tab 4. vink ssh2 as preferred connection.

Save the session as vnc or something.

If your computer is behind a firewall you better make sure these ports are forwarded for you, either by the firewall or by ssh. Otherwise this will not work of course.

Now fire up the session and log in (as root, but you can also do that as a user.)

In your browser go to You can log in and are now enjoying your linux desktop over ssh! Encrypted and very safe!

If something goes wrong, remember that putty has a log you can access to see what went on.

Are there any improvements you can make? Yes! You could use public key sessions, where you do nort have to log in at all with the ssh session. More later. You can also use compression with putty to make it all faster.

That's it! have fun!

Good questions no-one ever answers about libraries and compiling on linux.

februari 2002

Ok, you use unix (linux) and compile things. But what the hell are you really doing? I wondered a long time and am getting to know things slowly, because no-one ever bothers to explain. In this paper I will ask questions and try to find answers with links and so on.

Contents What is compiling?
What is gcc?
What are libraries (dll's in windows)?
What is the qt library?
What is the gtk library?
What is glibc?
For Linux there are three major libc versions
What is make?

What is compiling?

Back to contents | What is compiling? | What is gcc? | What are libraries (dll's in windows)? | What is the qt library? | What is the gtk library? | What is glibc? | For Linux there are three major libc versions | What is make? |
Compiling a small C program requires at least a single .c file, with .h files as appropriate. Although the command to perform this task is simply cc file.c, there are 3 steps to obtain the final executable program, as shown:

Compiler stage: All C language code in the .c file is converted into a lower-level language called Assembly language; making .s files.
Assembler stage: The assembly language code made by the previous stage is then converted into object code which are fragments of code which the computer understands directly. An object code file ends with .o.
Linker stage: The final stage in compiling a program involves linking the object code to code libraries which contain certain "built-in" functions, such as printf. This stage produces an executable program, which is named a.out by default.

Compile green.o: cc -c green.c
Compile blue.o: cc -c blue.c
Link the parts together: cc green.o blue.o

.h files are called header files and contain definitions. In qt for instance qevent.h contains eventhandlers you can use. The definition of an event that happens when you push a button is called an event handler.

What is gcc

Back to contents | What is compiling? | What is gcc? | What are libraries (dll's in windows)? | What is the qt library? | What is the gtk library? | What is glibc? | For Linux there are three major libc versions | What is make? |
GCC is a free compiler collection for C, C++, Fortran, Objective C and other languages. ( It includes The GNU Standard C++ Library v3, or libstdc++-v3.
"GCC" is a common shorthand term for the GNU Compiler Collection. This is both the most general name for the compiler, and the name used when the emphasis is on compiling C programs (as the abbreviation formerly stood for "GNU C Compiler").

When referring to C++ compilation, it is usual to call the compiler "G++". Since there is only one compiler, it is also accurate to call it "GCC" no matter what the language context; however, the term "G++" is more useful when the emphasis is on compiling C++ programs.

We use the name "GCC" to refer to the compilation system as a whole, and more specifically to the language-independent part of the compiler. For example, we refer to the optimization options as affecting the behavior of "GCC" or sometimes just "the compiler".

What are libraries (dll's in windows)?

Back to contents | What is compiling? | What is gcc? | What are libraries (dll's in windows)? | What is the qt library? | What is the gtk library? | What is glibc? | For Linux there are three major libc versions | What is make? |
For instance qtl is a library
What is the qt-library The Qt Template Library (QTL) is a set of templates that provide object containers. If a suitable STL implementation is not available for your compiler, the QTL can be used instead. It provides a list of objects, a vector (dynamic array) of objects, a map (or dictionary) from one type to another, and associated iterators and algorithms. A container is an object which contains and manages other objects and provides iterators that allow the contained objects to be accessed.

Back to contents | What is compiling? | What is gcc? | What are libraries (dll's in windows)? | What is the qt library? | What is the gtk library? | What is glibc? | For Linux there are three major libc versions | What is make? |

qt is the library at the basis of kde for example, see It is from trolltech. A tutorial is at qt is a bit like visual basic, and can be used on unix and windows and mac. The linux version is free, although the professional costs money.
The basis of the tool-kit/library are classes and objects called widgets. A widget is a user interface object that can process user input and draw graphics (ie buttons and so on).

What is the gtk library? (see

Back to contents | What is compiling? | What is gcc? | What are libraries (dll's in windows)? | What is the qt library? | What is the gtk library? | What is glibc? | For Linux there are three major libc versions | What is make? |
GTK+ is a multi-platform toolkit for creating graphical user interfaces, primarily designed for the X Window System.

GTK+ is free software and part of the GNU Project. However, the licensing terms for GTK+, the GNU LGPL, allow it to be used by all developers, even those developing proprietary software, without any license fees or royalties.

GTK+ has a C-based object-oriented architecture that allows for maximum flexibility, and consists of the following component libraries:

GLib - Provides many useful data types, macros, type conversions, string utilities and a lexical scanner.
GDK - A wrapper for low-level windowing functions.
GTK - An advanced widget set.

GTK+ == Gimp Toolkit
GDK == GTK+ Drawing Kit
GLib == G Libray

Things written with it are:
GIMP (, an image manipulation program
AbiWord (, a professional word processor
Gzilla (, a web browser
XQF (, a QuakeWorld/Quake2 server browser and launcher
GDK Imlib (, a fast image loading and manipulation library for GDK
Glade (, a GTK+ based RAD tool which produces GTK+ applications

When gtk won't work after compiling it:
Make sure that the libraries can be found. You want to edit /etc/ to include the directories which contain the GTK libraries, so it looks something like:
Then you need to run /sbin/ldconfig as root. You can find what directory GTK is in using
gtk-config --libs
If your system doesn't use to find libraries (such as Solaris), then you will have to use the LD_LIBRARY_PATH environment variable (or compile the path into your program, which I'm not going to cover here).

What is glibc?

Back to contents | What is compiling? | What is gcc? | What are libraries (dll's in windows)? | What is the qt library? | What is the gtk library? | What is glibc? | For Linux there are three major libc versions | What is make? |
What about the versions of glibc and so on?
Any Unix-like operating system needs a C library: the library which defines the ``system calls'' and other basic facilities such as open, malloc, printf, exit...
The GNU C library is used as the C library in the GNU system and most newer systems with the Linux kernel.
The history of Unix and various standards determine much of the interface of the C library. In general the GNU C library supports the ISO C and POSIX standards. We also try to support the features of popular Unix variants (including BSD and System V) when those do not conflict with the standards. Different compatibility modes (selectable when you compile an application) allow the peaceful coexistence of compatibility support for different varieties of Unix.
 1.09.1 was a static library in the style of the 80s;
Version 2 is built as a shared library --- in fact, multiple shared libraries. Several parts of the library are separated out and are dynamically linked into the process when needed.

What version of libc are there and can you use them independently?

Back to contents | What is compiling? | What is gcc? | What are libraries (dll's in windows)? | What is the qt library? | What is the gtk library? | What is glibc? | For Linux there are three major libc versions | What is make? |

The following lines form the glibc faq at say it all:

Can I replace the libc on my Linux system with GNU libc?
{UD} You cannot replace any existing libc for Linux with GNU libc. It is binary incompatible and therefore has a different major version. You can, however, install it alongside your existing libc.
For Linux there are three major libc versions:
libc-4a.out libc
libc-5original ELF libc
libc-6GNU libc

2.3. How should I avoid damaging my system when I install GNU libc?

{ZW} If you wish to be cautious, do not configure with --prefix=/usr. If you don't specify a prefix, glibc will be installed in /usr/local, where it will probably not break anything. (If you wish to be certain, set the prefix to something like /usr/local/glibc2 which is not used for anything.)

The dangers when installing glibc in /usr are twofold:

glibc will overwrite the headers in /usr/include. Other C libraries install a different but overlapping set of headers there, so the effect will probably be that you can't compile anything. You need to rename /usr/include out of the way before running `make install'. (Do not throw it away; you will then lose the ability to compile programs against your old libc.)
None of your old libraries, static or shared, can be used with a different C library major version. For shared libraries this is not a problem, because the filenames are different and the dynamic linker will enforce the restriction. But static libraries have no version information. You have to evacuate all the static libraries in /usr/lib to a safe location.

The situation is rather similar to the move from a.out to ELF which long-time Linux users will remember.

You can have any combination of these three installed. For more information consult documentation for shared library handling. The Makefiles of GNU libc will automatically generate the needed symbolic links which the linker will use.

What is the 'linker' of glibc?
2.6. When I use GNU libc on my Linux system by linking against the which comes with glibc all I get is a core dump.

{UD} On Linux, gcc sets the dynamic linker to /lib/ unless the user specifies a --dynamic-linker argument. This is the name of the libc5 dynamic linker, which does not work with glibc.

For casual use of GNU libc you can just specify to the linker


which is the glibc dynamic linker, on Linux systems. On other systems the name is /lib/ When linking via gcc, you've got to add


to the gcc command line.

What is make?

Back to contents | What is compiling? | What is gcc? | What are libraries (dll's in windows)? | What is the qt library? | What is the gtk library? | What is glibc? | For Linux there are three major libc versions | What is make? |
The make program aids you in developing your large programs by keeping track of which portions of the entire program have been changed, compiling only those parts of the program which have changed since the last compile.