Skip to Content

Introduction to GNU/Linux for M$ Window$ users

Alaa's picture

1 Introduction

I will attempt to use a consistent layout for this document:

NAMES OF PEOPLE AND PROGRAMS WILL BE IN NOUN STYLE LIKE THIS.

'ARABISH1 WORDS WILL BE IN NOUN STYLE AND QUOTED LIKE THIS'

file names and directories will be emphasized like this.

Warning and Important notices will be emphasized and bold.

commands entered by a normal user will be preceded by a dollar sign $.

command entered by root will be preceded by a hash sign #.

>any output the computer produces will be in typewriter style
>preceded with arrows like this.

any input or commands you should enter will be in typewriter style.

``quotes will look like this and will be followed by a reference pointer.''
Most examples and commands are to be executed from the command prompt of the console or an X terminal, if your system automatically runs the X windows you have to open an X terminal2.

You can skip the first section completely and jump to the practical problems and solutions, I intend to use heavy referencing to make it easier to jump from different locations in the document; a table of contents is inserted at the top of the document for your convenience.

2 Conceptual Differences

1 The Nature of LINUX

You may have heard/read the names LINUX, GNU, GNU/LINUX, X WINDOWS, KDE, GNOME, RED HAT, MANDRAKE, distro and a lot of other names, in the beginning its not clear what they all mean.

You probably already know that LINUX is free, but you know there are companies selling it, and then there is all this talk about the source, what does it all mean??.

1.1 What is LINUX ?

Strictly speaking LINUX is a an operating system kernel; a kernel is the part of the operating system that is responsible for the very basic operations of your system.

``The LINUX kernel acts as a mediator for your programs and your hardware. First, it does (or arranges for) the memory management for all of the running programs (processes), and makes sure that they all get a fair (or unfair, if you please) share of the processor's cycles. In addition, it provides a nice, fairly portable interface for programs to talk to your hardware.[1]''
The LINUX kernel was first written by LINUS TORVALD when he was a student, it is now being developed by thousands of developers around the world.

Mostly when people speak about LINUX they mean the GNU/LINUX operating system which is the OS that runs your computer. GNU stands for (GNU IS NOT UNIX) it is a free clone of the popular UNIX operating system.

GNU was first written by RICHARD M STALLMAN the chairman of the Free Software Foundation http://www.fsf.org (FSF|), since the GNU system was still missing a kernel3, it was combined with the LINUX kernel to make the GNU/LINUX operating system.

GNU are all the basic tools you use in maintaining your system, it also includes lots of applications, libraries and a compiler.

1.2 What is a Distribution ?

Distributions or distros are products made by companies to simplify the installation and configuration of a GNU/LINUX operating system, some of the most popular distro are RED HAT, MANDRAKE, SUSE and DEBIAN. They are all GNU/LINUX and so they're very much similar, most software you use under LINUX is being developed independently from these distributions so applications will look and feel the same no matter what distro you use. The distro however provides you with an easy install script and wizards to automate lots of the configuration tasks, it also provides lots of precompiled packages that you can use directly without having to configure and compile yourself. The companies that make these distros also provide technical support, manuals and other services for their customers.


1.3 LINUX is Free ?!

Yes LINUX is free, but its not necessarily free as in zero price 'MAGANY'4 it is free as in freedom '7OR' this means that you the user have certain freedoms that no one can take from you.

``* The freedom to run the program, for any purpose (freedom 0).
* The freedom to study how the program works, and adapt it to your needs (freedom 1). Access to the source code is a precondition for this.
* The freedom to redistribute copies so you can help your neighbor (freedom 2).
* The freedom to improve the program, and release your improvements to the public, so that the whole community benefits. (freedom 3). Access to the source code is a precondition for this.[2]''
This simply means that you have the right to make any number of copies of GNU/LINUX and distribute them in any way you like; even selling it. And it means that you have the right to change it in anyway you like and distribute your changes.

This is not the way WINDOWS or any other commercial software is, with WINDOWS you have no legal right to make copies of it; you can't even install it on more than one computer even if its yours. And there is no way you can access the source code for WINDOWS or be able to modify it.

If you manage to modify it you are not allowed to tell the world about it, even if your modification is an important bug fix or a new feature that MICROSOFT was never going to implement.

1.4 LINUX is Open Sourced ?!

As we mentioned in the previous section in order for GNU/LINUX to be free you the user must have access to the source code5. when the code of a piece of software is available to the public to study it is called open sourced.

All free software is open sourced, but not all open sourced software is free, some programs may allow you access to the source code but you can't modify or distribute it as you please[3].

1.5 LINUX is GPLed ?!

The GPL[4] or the GNU GENERAL PUBLIC LICENSE is the most popular and strongest free software license, it is the GPL that ensures you have all the freedoms described in section 1.3, the GPL is a strong license because it is a copyleft license, copyleft (as opposed to copyright) means that if you distribute modified GPL software your modifications should be distributed under the GPL too, this ensures that no company can take a GPLed program and turn it into a secret closed one restricting its user's freedoms[5].

MICROSOFT software is distributed under an END USER LEGAL AGREEMENT that is very restrictive, any breach of this agreement (like making a copy of WINDOWS for your friends) is considered a criminal act and puts you in the risk of heavy sentences.

1.6 Who owns LINUX ?

Free software has no owners, although the FSF holds the copyrights to the GNU system and LINUS holds the copyrights and trademarks to LINUX; this only means that no one can go and make another product and call it LINUX or GNU and that no one else can claim they were the first to write LINUX.

Not even LINUS or the FSF can restrict your freedoms to use and modify the GNU/LINUX system.

1.7 We've always copied WINDOWS any way!

Or in other words, why do we need free software, if its safe to copy non free software?!

You may think it is safe to copy non free software, this is more or less true if you are a home user, but large organizations such as companies and government agencies cannot afford to run illegally copied software anymore, with the pressure generated by extra-territorial laws and international agreements such as the GATT. If you are trying to set up a small business then most probably you cannot afford the price of commercial software licenses (think of what will happen to all these offices in 'BEIN EL SARAYAT' if they had to pay for the software they use).

But free software isn't about the price only, when you buy non free software form a company like MICROSOFT, you have to rely on MICROSOFT for support and further development of the software, if you are a computer professional you have to rely on MICROSOFT for certification and training. This means more money to be paid for a foreign economy, but since LINUX is free, you can set up your own LINUX company that supports and further develops it; this way when someone buys your product or request your services the money will benefit your local economy.

With free software it doesn't matter how underdeveloped the country is or how far ahead the rest are, when technology is free we can really own it. If technology isn't free then we have to choose between reinventing the wheel or relying on others to provide us with it.

1.8 I'm not a programmer why do I need the code ?

Even if you are not a programmer the openness of the code is very important to you, its because the code is open and free that GNU/LINUX is such a reliable OS, since thousands of programmers are working on developing and fixing it.
If a anyone finds a bug they can look at the code and fix it, if you find a bug and can't fix it yourself you can report it and someone else will fix it. If there is a feature in a free software package that is missing you can hire someone to develop it for you, and if this feature is useful for many people you can probably find someone to implement it for free.

The open sourced nature of GNU/LINUX protects you from security problems and trap doors, since the system is heavily peer reviewed by the world best programmers. With WINDOWS you cannot tell if it has trap doors or not, you cannot know if it sends data about you compromising your privacy.
Actually MICROSOFT software is known to be full of secret undocumented features, for instance all office documents carry a special ID that is unique to your machine, thus compromising your privacy.

WINDOWS is notorious for its security problems and its weakness towards viri, GNU/LINUX on the other hand is very secure and no known virus was ever able to harm it thanx to its open nature.

Availability of the code also ensures that your favorite piece of software will not suddenly die because its author lost interest or got busy, since its free anyone can develop it and release new versions, you don't need to rely on one vendor.

2 The UNIX Heritage

As we told you before, GNU is a UNIX clone, so its natural that GNU/LINUX would share many common features with UNIX, it is this UNIX heritage that makes GNU/LINUX so different from M$ WINDOWS, in this section we'll explore the basic ideas behind a UNIX system.

2.1 What is UNIX anyway?

UNIX is the oldest living operating system, it was first written by KEN THOMPSON and DENNIS RITCHIE6 when they were working at AT&T, it could be considered as the grand daddy of all operating systems in use today.

AT&T licensed UNIX to many companies and universities, who in turn developed their own versions of it, which resulted to many different UNICES, these UNICES fall into the two wide categories of BSD UNIX and AT&T UNIX.

Efforts to standardize all these UNICES resulted in the POSIX standard, GNU/LINUX is very POSIX compliant.

2.2 You still use the command line? Isn't that archaic?

No not at all, most UNIX and LINUX users would tell you that the command line is much more powerful and versatile. This power of the command line is an integral part of the UNIX philosophy.

So while WINDOWS is trying very hard to get rid of the command line, GNU/LINUX relies on it for all its functionality, to the point that most graphical tools and applications rely on command driven tools to do the real work. This of course give you the best of the two worlds, and most important of all it gives you choice.

So if you prefer Graphical User Interfaces (GUI) go ahead, you'll find it as easy to use as WINDOWS and even more powerful.

But if you want to release the power of your computer and your mind try to learn the command line, its not as scary as it seems.

2.3 The UNIX philosophy

I told you that UNIX is an operating system, but to think of it as a mere OS would be a gross understatement, it is much more than that, it is a complete philosophy specifying that small and simple is better. All UNICES are geared around the idea that writing small programs that do one job but do it perfectly thus becoming tools and not applications gives the user more power since he can combine these tools and use them together to get a result that is greater than the sum of these tools.

But the efficient use of these tools depends on the creativity and intelligence of you the user.

So unlike WINDOWS which assumes you have the IQ of a potato and tries to tell you how to do things, GNU/LINUX like all UNICES waits for you to harness it and tell it what you want done.

2.4 Multi user & multi tasking

Although the UNIX command line looks a bit like the old DOS command line which still lives in the heart of WINDOWS, don't be fooled by its appearance it is much more powerful than DOS.

UNIX is from day one a multi tasking environment, which means you can run several task at the same time.

try this:

$ mpg321 somesong.mp3 &
This will start playing the MP3 you specified and returns you to the command line, now you can run another command while the song is still playing.
Its by adding & at the end of a command that you inform GNU/LINUX to run this command in the background thus leaving you free to continue your work.

But thats not all GNU/LINUX is a multi user system too, since it was designed for a networking environment it allows several users to use the computer and run different programs at the same time.

Try it your self press Ctrl-F2 and a new login screen will open, you can login with a different account, or even open a new session of the same account.

You may think this is only useful for satisfying split identity disorders, but on the contrary as you get used to GNU/LINUX you'll find many uses for this feature.

WINDOWS is not really a multiuser OS although it acts as if it is, this multi user nature of GNU/LINUX is one of the main reasons behind many confusions to new users, issues like ownership and permissions would make perfect sense when you understand the multi user nature of UNICES.

2.5 Only one tree ! or a look at the file system.

While WINDOWS is based around the idea of drives, where every partition and media has its own drive name (like C: D: E:) and each drive has its own directory tree that begins with a root directory for every drive (C:\, D:\, E:\). GNU/LINUX on the other hand follows the UNIX tradition of having only one tree. This tree has only on root directory (/) and all partition and media are connected to this tree through a process called mounting.

So in WINDOWS if I want the second partition I have to go to D:, but in GNU/LINUX I'd go to the directory /mnt/win_d

This is a bit confusing in the beginning but you'll get used to it quickly.

The fact that GNU/LINUX has only one tree, meant that it could have a much more organized file structure, where files are grouped together by their type and function instead of letting each program handle its own files in any random way.

2.5.0.0.1 The basic file structure of GNU/LINUX is discussed in section.

2.6 Everything is a file

This is one of the most confusing yet powerful aspects of GNU/LINUX.

By everything we mean literally everything; directories are files, hard disks are files, partitions are files, Internet connections are files. EVERYTHING is a file in GNU/LINUX.

But this makes us wonder what is a file exactly??

In a very non formal way a file is just a stream of bytes, and you can usually read and write streams of bytes to the file.

Files could either be:

normal files
this includes all the files you deal with everyday like text files, binary files, MP3S and HTML documents.
directories
directories are sometimes called folders.
devices
this includes all devices whether real or logical, like hardisks and their partitions, mice and network connections.
named pipes
these are special files used to link the output of a program with the input of another program.
sockets
are special files used for networking and communication between different processes.

2.7 Funny Names :-)

Yes UNIX tools and programs always had funny and interesting names, GNU took this to an extreme like the pager called LESS because it is a more powerful pager than the pager called MORE.

These naming conventions reflect a whole culture; the Hackers' culture, which in itself reflects how fun and enjoyable computing could be.

This is one of GNU/LINUX'S main advantages over WINDOWS, it is fun, it doesn't try to hide its weaknesses with obscure technical messages and yet it doesn't try to sound too stupid and dumb (ala my computer style).

For an interesting look at Hackers' culture check The Jargon File http://www.tuxedo.org/ esr/jargon/html/index.html.

3 The File System

As mentioned in the previous section, the GNU/LINUX system follows the UNIX tradition by having one tree only, in this section we study with more details the organization and structure of this tree and of various file types.

3.1 File System support

One point where GNU/Linux excels is its wide support of file systems, your GNU/Linux file system could access nearly all file systems in use today7, This means that you don'thave to worry about what other OSes you or your friends use, for instance you could have all your media files stored in a windows partition so you can use them from both Linux and Windows.

originaly the native file system for GNU/Linux was minix, but then Linux finaly had its own file system called ExtFS which stands for Extended File System.

the FS most widely used today is EXT2FS.

3.2 Linux doesn't know how to defrag?!

yes can you believe it, they spent all this time and effort making it and no one thought of making a defrag utility!

but slow down, the Linux native file systems don't need a defrag utility, yes thats right ExtFS is sooo good and stable it doesn't need to defrag at all!

Windows as you are sure to know needs defraging once a month.

3.3 What about scandisk, can I forget about that too

not so fast, while Linux is much better than windows at handeling the file system, and since it is much more stable, data loss of the harddisk hardly happens without your help, but since nothing is perfect8 you still need a file system checking and repair tool, in GNU/Linux its called fsck.

most distros will run a fsck every twenty or thirty reboots, and off course if you ever restart the computer without closing the system it will do a fsck.

3.4 What if I use journaling

some file system use a technology called journalling, journalling simply means that the FS keeps track of all changes made and changes that should be made in a special table called the journal, the journal is written to the harddisk frequently, so when harddisk crash or power outage happens, the file system can go back and finish what needs to be done or undo what needs to be undone.

the native EXT3FS adds journaling to EXT2FS, thus making it more stable and giving you the benefit of nearly never running a fsck.

another nice thing about EXT3 is that it uses the same structure as EXT2 this means that migrating from EXT2 to EXT3 or back takes seconds and there is no risk of data loss involved.

3.5 Files and their properties.

the fact that GNU/Linux uses a different file system from windows means that there are some differences in how it handels files and in the properties and attributes of these files, most of these attributes are necessary for a multiuser envirement.

you should know about these properties in order to avoid problems and be able use GNU/Linux efficiently.

3.5.1 Filenames are case sensitive

unlike windows, file names in GNU/Linux are case sensitive, this means that files foo, Foo, FOO and fOo are different files. this could cause lots of confusion when you are looking for files or applications.

very few excutables9 have capital letters but you should still be careful.

3.5.2 Linux Does Not Need Filname Extensions?

While Widows uses file extensions to determine the data type of files. GNU/Linux does not need filename extensions at all, you'll find thousands of files with no extension in your GNU/Linux system10, intead GNU/Linux uses a tool called file to determine the datatype of each file.

however note that some GUI apps specially MIME enabled apps use extensions to guess the type of media files.

you can run the file tool yourself to check the datatype of file like this

$file fubar.pdf

>fubar.pdf: Ogg-Vorbis compressed sound file

as you can see file is too smart to be fooled by a wrong extension.
$file foo

>foo: Bourne-Again shell script text executable

it can even guess what kind of text file you have
$file hello_world.cc

>hello_world.cc: ASCII C program text

as you see, file isn't always accurate, it mistooke my C++ code for C code.

3.5.3 File ownership

because of the multi user nature of GNU/Linux systems, files have ownership, since you cannot let users read each others email and delete each others work.

each file has an owner and belongs to a group. to see who owns certain files you do this

$ls -l

>-rwxrwxr- 1 foo mail 26624 Jan 27 06:02 foo

>-rw-rw-r- 1 foo code 300 Feb 7 14:15 hello_world.cc

>-rw-r-r- 1 root root 3932007 Feb 7 01:42 fubar.pdf

^^^^ ^^^^

the third column is the file ownership, the fourth column is the group.

these two values are sometimes reffered to as UID and GID (which stands for User ID and Group ID)11.

as you can see from the listing, the owner of foo is user foo and it belongs to group mail, the owner of hello_world.cc is foo and it belongs to the group code and finaly the owner of fubar.pdf is root and it belongs to group root12.

but what are groups??

groups are a way to give multiple users access to the same files or resources, all users belonging to the group mail can send and recieve mail, all users belonging to the group audio can play music, etc.

3.5.4 File Permissions

permissions are file attributes that tell the system who has access rights to files and directories.

to see file permission you need to run this command again

$ls -l

>-rwxrwxr-x 1 foo mail 26624 Jan 27 06:02 foo

>-rw-rw-r- 1 foo code 300 Feb 7 14:15 hello_world.cc

>-rw-r--- 1 root root 3932007 Feb 7 01:42 fubar.pdf

^^^^ ^^^^

the first column has the filetype and permission information, the first character __ which happens to be - in the three files listed here __ is the file type, we will ignore it for now, its these strange rwxrwr runes that we are looking for now.

the letters r, w, and x are used to represent different permissions.

r
stands for read permission, if you have read permission to a file you can read from it and see it content.
w
stands for write permission, if you have write permission to a file you can write to it and modify it.
x
excute permmision, if you have excute permission to a file you can run the file.
Windows uses filename extensions to determine if a file is excutable or not, GNU/Linux uses permissions instead.

but why does the listing have more than one r,w and x??

this is because there are three sets of permissions:

owner permissions13
this is the set of permission for the owner of the file, only the owner can change a files permission.
group permission
this is the set of permission for all users who belong to the files's group.
world permissions14
this is the set of permissions for all users.
each set of permissions is represented by three characters and there order is owner permissions, group permissions and world permissions, the first character is the read permission, the second character is the write permission and the third character is the execute permission. if a - is used instead of r,w or x this means no permissions.

for instance in the previous listing the file foo is readable,writable and executable by its owner the user foo, and it is also readable, writable and executable by all members of the group mail. but other users only have read and execute permissions

while the file hello_world.c is readable and writable by its owner foo and all members of the group code. other users are only allowed to read it.

and finaly the file fubar.pdf is readable and writable by the its owner the user root, other members of the group root can only read it and the rest of the world has no access to it at all.

3.5.5 Directory permissions

since directories are files, they too have the same set of permissions, but their meaning is a bit different from files.

for directories the read permission means you have the right to

r
if you have read permission to a directory you can list the directory contents.
w
if you have write permission to a directory you can modify the files contained in it or add new files.
x
if you have excute permission to a directory you can enter that directory.
this means that the permission to delete a file is a write permission to the directory, if you have write permission to the directory /fubar and no write perimission to the file /fubar/fu you can still delete /fubar/fu

an interesting situation occurs when you only have excute permission to a directory, in that case you have the right to enter the directory but you cannot list its content, you can however read any file in the directory if you have the permission to that file, but you cannot tell what the filenames are.

if you have read permission only you can list the files inside the directory but you cannot access them at all.

so to be able to modify a file you have to have all permissions to its parent directory.

Remember the delete permission is a directory write permission

3.6 Directory Organization

Unlike WINDOWS programs, all GNU/LINUX Programs follow a standard way of organizing files based on the content and function of the files, similar files are grouped together and put in one directory.

These directories don't have to belong to one partition, they could even belong to another computer on the network.

Lets explore these directories.

/bin15
contains all programs neccesary for the correct operation of the system, they are not stored in /usr/bin because it is common to have /usr on a different location which may not be accessable for any number of reasons like a network failure.
/boot
contains all the kernel images used to boot your computer.
/dev
contains all your devices.
/etc
contains all system wide configuration files that apply to all users.
/home
contains the home directories of all the users, users store their personal data and configuration files there. It is common to have a seperate /home partition.
/lib
contains libraries needed to run the basic operations of the system.
/mnt
where most external media and extra partitions are mounted.
/proc
a virtual file system that contains special files which carry information about your system.
/sbin
basic system programs that can only be used by root, needed for correct operation of the system.
/tmp
contains temporary files.
/usr
all files accessible by users, contains all programs binaries, data files and documentations among other things.
/var
all variable data like log files, different caches and print and mail spools.

Bibliography

1
The Linux Kernel HOWTO http://www.linuxdoc.org/HOWTO/Kernel-HOWTO-3.html
2
FSF: The Free Software Definition http://www.fsf.org/philosophy/free-sw.html
3
The Open Source Initiative: Open Source Definition http://www.opensource.org/docs/definition_plain.html
4
FSF: GNU General Public License http://www.fsf.org/licenses/gpl.html
5
FSF: What is Copyleft? http://www.fsf.org/licenses/licenses.html#WhatIsCopyleft

About this document ...

Main Differences Between GNU/LINUX and M$ WINDOWS

This document was generated using the LaTeX2HTML translator Version 2002-2-1 (1.70)

Copyright © 1993, 1994, 1995, 1996, Nikos Drakos, Computer Based Learning Unit, University of Leeds.
Copyright © 1997, 1998, 1999, Ross Moore, Mathematics Department, Macquarie University, Sydney.

The command line arguments were:
latex2html -no_subdir -split 0 -show_section_numbers /tmp/lyx_tmpdir24679ybuTjF/lyx_tmpbuf0/linuxintro.tex

The translation was initiated by alaa on 2004-08-05


Footnotes

...'Arabish1
Arabic words written in Latin letters 'KEDA YA3NI'
...terminal2
The panels of KDE and GNOME usually comes with a button that looks like a black computer screen clicking on it will open a terminal.
... kernel3
The GNU kernel HURD is now nearly complete and many developers are using it right now.
...magany'4
Although it is most of the time.
... code5
The source code is a detailed description of a program written in a programming language, LINUX and GNU are written in C.
... Ritchie6
Who was the author of the C language
... today7
This needs some special kernel configuration though, most distros will support the very popular file systems.
... perfect8
specially the power supply
... excutables9
files that run applications and programs
... system10
file name extensions are usually three characters that follow the dot (.) like .ogg in foo.ogg
...11
actualy UID and GID are usualy used to refer to a numerical ID that identifies users and groups. to see a listing of files with numerical UID and GID data instead run this
$ls -ln
... root12
the root user's UID is always 0
... [owner permissions13
sometimes refered to as user permission
... [world permissions14
sometimes refered to as others permissions
.../bin15
bin stands for binaries, directories called bin contain excutable files and programs.

Comments

khaledhosny's picture

ايه اللخبطة دى

حد يبص على المقال ده ويشوف ايه المشكلة فيه عشان أنا مش فاهم حاجة


Conceptor's picture

input format the Input format was

the Input format was wiki/html ,when I set it to full html i found it more readable.

it's better to reformat it with wiki syntax instead of using html,to make it easier for people to contribute.


Diaa Radwan

Alaa's picture

this was an import from

this was an import from LyX waaay back in lug history, you are right wikifying will be better. also breaking into multiple pages

Alaa


husband of the Grand Waragi Master

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.


Dr. Radut | book