# Linux Starter Guide



## piyushp_20 (Jan 1, 2009)

Read this article first *www.itwire.com/content/view/20861/1141/  ​*
Introduction to Linux*​ 
Linux is a UNIX like operating system which runs on a variety of platforms, especially personal computer with Intel 80386 processors or better.

It supports a wide range of software, from TEX, to the XWindow system, to the GNU C/C++ compiler, to TCP/IP. It’s a versatile implementation of UNIX, and *freely distributed under the terms of the GNU General Public Lisence.

*Linux can turn any 80386 or better personal computer into a workstation that puts the full power of system to manage financial and hospital records, distributed computing environments, and telecommunications.

Universities worldwide use Linux to teach courses on operating system programming and design.

Computing enthusiasts everywhere use Linux at home for programming, productivity and all-around *hacking.*

What makes Linux so different is that it is a free implementation of UNIX. It was and still is developed cooperatively by a group of volunteers, primarily on the Internet, who exchange code, report bugs, and fix problems in an open-ended environment.

*Architecture*
  *img396.imageshack.us/img396/7313/architectureuw0.png



Linux OS is a modular system, which means that the components can function without one another. Because of its modular nature, you can create a highly customized Linux OS based on you individual requirements. Some of the typical Linux modules are explained below:


_Kernel_
It is the core component of the OS.

It coordinates communication between the hardware and other software components.

It is the only component that is technically Linux. All other components are add-ons that turn the system into a fully-functional OS.

_Shell_ 
It is the user interace that accepts and interprets commands (either from a command prompt or a script) and forwards them to the kernel.

A Linux shell is comparable to the DOS interpreter/DOS prompt.

The most common shell is *bash** (Bourne-Again Shell).*
_
Graphical User Interface (GUI)_ 
The GUI is responsible for drawing graphical elements on the computer screen.

The Linux GUI was designed to work the same way regardless of the video hardware on the computer system.

The most common GUI is the X-Windows system.
_
Window Manager / Desktop Environment_
It modifies the GUI output that comes from X-Windows.

To change or modify the X-Windows output, you can simply change the window manager.

You can also use a desktop environment with a window manager.

A desktop environment provides software (e.g. web browsers and file managers) and gives users access to common tasks.

KDE (Kommon Desktop Environment) uses K window manager and GNOME (GNU Object Model Environment) uses Metacity window manager.
_
Windows Emulator_
  A Windows emulator is an implementation of the Microsoft Windows API.

The emulator lets you run Windows applications on Linux without running the Windows OS.
*
Wine *is the best example of the Windows Emulator.
_
Boot Loader_
  A boot loader runs after the system executes the BIOS ROM and POST functions.

It loads the Linux kernel from the boot partition on the hard disk.

It is also used to boot other OS present on the computer.
_
Applications and Utilities_ 
Utilities are special programs that help you manage the system.

Applications that let you use the computer for specific tasks (such as word processing, listening to music, or managing data).
_
Daemons (services)_ 
Daemons are programs that run in the background, providing additional functionality to a system.

The Windows equivalent of a daemon is a service.     
*
Linux Hierarchy*
*Directory* - Description

*/* - The / character   represents the root directory of the Linux system. All directories are below   the / (root directory) of the system.
*/bin* - The /bin directory   contains binary commands that are available to all users.
*/boot* - The /boot   directory contains the kernel and boot loader files.
*/dev *- The /dev directory   contains device files.
*/etc* - The /etc directory   contains configuration files specific to the system.
*/home* - The /home   directory contains by default the user home directories.
*/intitrd* - The /initrd   directory is used during the boot process to hold the initial RAM drive   image.
*/lib* - The /lib directory   contains shared program libraries and kernel modules.
*/media* - The /media   directory contains the /cdrom and /floppy directories. It is the point where   CD-ROM and floppy drives can be mounted according to the FHS (Filesystem Hierarchy   Standard) v2.3
*/mnt* - The /mnt directory   is an empty directory. This was the mount point for CD-ROM and floppy drives   prior to FHS v2.3
*/opt*-The /opt directory   contains the additional programs.
*/proc* - The /proc directory   contains information about the system state and processes.
*/root* - The /root   directory is the root user’s home directory. Do not confuse /root with the   root of the system (/).
*/sbin* - The /sbin   directory contains system binary commands.
*/srv* - The /srv directory   contains files for services like the FTP and Web servers.
*/sys* - The /sys directory   is new with release 2.6. It takes some of the system state date that was   previously contained in /proc.
*/tmp* - The /tmp directory   contains temporary files created by programs during system use.
*/usr* - The /usr directory   contains system commands and utilities. /usr holds the following directories:
·/usr/bin
·/usr/lib
·/usr/local
·/usr/sbin
·/usr/X11R6 (for the X-Windows system)
   Depending on the   implementation, the /usr directory might also include the /usr/doc   subdirectory (or /usr/share/doc subdirectory) to hold documentation   accessible to all users.
*/var* - The /var directory   contains data files that change constantly. Standard subdirectories include:
·/var/mail (holds e-mail in boxes)
·/var/spool (holds files waiting for   processing, such as print jobs or scheduled jobs)
·/var/www (holds www or proxy cache files)

*
Linux Distribution*

   A Linux distribution is a collection of components packaged to work together as a complete system. A package is the collection of components (tools, software, utilities, devices, etc) put together to make a distribution.
  Each package (distribution) can use a package manager, which is a tool that installs and maintains a Linux package.
*Distribution* - Characteristics.
*Example :-*

*RPM* - RPM distribution uses Red Hat package manager. These are most common commercially available distributions.
*Example* :- Red Hat, SUSE, Mandrake.
*Debian* - It uses Debian package manager. It contains largest collection of packages.
*Example* :- Ubuntu, Xandros.
*.tar.gz/.tgz/Slackware* - This doesn’t use a package manager.
*Example* :- College Linux, SLAX.
*Source-based* - These are designed to work from source code. User compiles the source code and then installs it.
*Example* :- Gentoo.
*
*
*Installation*

*Note*: Installation process of all the distribution differs in some or the other manner, so the following step-by-step guide gives the general process.
·Identify network requirements, select a distribution, verify that all hardware meets system requirements.
·Select an Installation file location (*) and Installation method (**).

·Start the installation.
·Choose the installation language and the system keyboard and mouse.
·Partition the hard disk.
·Configure the boot loader.
·Choose a system language and time zone.
·Create user accounts and configure authentication.

*(*) *


> *Installation file location* - Description
> 
> 
> *CD-ROM or Removable media* - Installation files are on a disk or other removable media such as USB.
> ...


 *(**)
*


> *Installation method* - Description
> *GUI* - You make choices using the mouse and the keyboard from Graphical screens. It is the default install on most distributions.
> *Text*  - It gives the basic text screens bypassing the GUI. We use this when the system is really old.
> *Scripted* - You answer all the installation questions. Responses are stored in a file that is then read by the install program. Otherwise known as fully automated installation


*

Part - II Shell and some commands*
​    Shell is the interface between user and operating system. It basically converts human readable language to binaries. Users and corresponding programs send commands to the kernel.
  The most common shells which you will come across are
*Bourne Shells* – It use syntax and conventions similar to a UNIX shell. The *bash *(bourne-again shell) includes many improvements and is the default shell for new Linux installations.
*C-Shell*   -  it uses syntax which is similar to the C programming language.
  In linux shell is just a component so you can easily choose the shell which you want to use or can have multiple shells at a same time.

*Terminology used in this guide*
*NOTE:- please make sure that linux is case sensitive, even spaces matter.*
*Path* – It is the location of an object in the file system.
*Path variable* – It stored the list of directories that are searched to execute a command without a absolute or relative path.
*Working Directory* – It is the directory a user is currently in. (to know in which directory are you than just type the command “*pwd*”.)


*File system commands*

*
Command* - Description
*ls*or*ls* path - View a list of files in a directory
*ls –l*  - View a long listing of files, including file type, permissions, owners, file size and access time.
*ls –a*  - View a listing of all files, including hidden files.
*ls –aR*  - View a listing of files, including hidden files, and including files in all subdirectories (recursive).
*cd* /path  - When used with a relative path, moves down the directory structure from the current working directory.
*cd ..*  - Move up one level in the directory structure from the current working directory. 
*cd* or *cd** ~*  - Change the working directory to the user’s home directory.
*pwd* - Shows the current working directory as screen output (stands for *p*rint *w*orking *d*irectory).


*
Some facts:* 

·The file name of a hidden file begins with a period “*.*” (dot). There is no hidden attribute in Linux.
·To move directly to the root directory, simply type *cd /*
·If the output from a command scrolls, than in that case add *| more *with the command and the screen will show as one screen at a time.
·To run a file from the current directory than add *./ *before the filename.
*

File viewing and searching commands*

*Command* - Description
*Example:-*


*|  -  *Redirect the output of one command to use it as input for another command. The pipe (|) is one of several redirectors.
*Example:- ls –l | less *redirects the output of the ls command into the less paging program.

*>  - *Redirect the output of a command into a file. This is the single redirector, which overwrites the files contents.
*Example:- echo ‘This has been overwritten’ > filename *redirects the output of the echo command to the file ‘filename’ overwriting the data.

*<  -  *Redirect a file to the standard input of a command.
*Example:- cat </etc/hosts *redirects /hosts file to act as input for the *cat* command.
*
>>  -  *Redirect the output of a command into a file. This is the double redirector, which appends the redirected output to the end of the file.
*Example:- echo ‘bla bla bla’ >> filename *redirects the output of the echo command to the file ‘filename’ appending the text.
*
cat *_filename_  - Display the contents of a file. You can use a second filename parameter with cat to concatenate two files.
*Example:- cat /etc/lilo.conf *displays the contents of the lilo.conf file.
*
cat *_filename filename2_  - Append filename2 to the end of filename and display the result on the screen.
*Example:- cat /etc/lilo.conf /etc/passwd *appends the passed file to the end of the lilo.conf file and displays the results on screen.
*
cat*_ filename_ *| more  - *Show the contents of a file, one screen at a time.
*Example:- cat /etc/passwd | more *displays the passwd file one line at a time.
*
cut *_options filename_


> common options:
> 
> -b Show bytes as a list.
> -c Show characters as a list.
> ...


  -  View the selected columns or fields from one or more files.
*Example:- cut –d: -f /etc/passwd *displays usernames(in the first colon-delimited from the passwd file).
*
echo *_‘text’_  - Display the text as output.
*Example:- echo ‘This is some text’ *displays the message on the screen.
*
find*_path options ‘string’_  - Descend through directories searching for files with certain attributes or executing commands.
*Example:- find /etc –name ‘*.conf’ *finds all files in the /etc directory that end in .conf
*
grep *_‘text string’ filename_  - Search for the text string and display lines from text 
files that match the text string.
*Example:- grep ‘root’ /etc/passwd *finds and displays all lines in the passwd file containing the text string root.
*
head *_filename_  - View the first ten lines of a file.
*Example:- head /etc/passwd *displays the first ten lines of the passwd file.
*
locate *_filename_  - Locate files with the designated filename.
*Example:- locate usr *displays all files matching the usr filename.
*
tail *_filename_  - View the last ten lines of a file.
*Example:- tail /etc/passwd *displays the last ten lines of passwd file.
*
Whereis *_options filename_


> Common options:
> -b binary
> 
> -s source
> ...


  - Locate the binary, source, or manuals (man) files for the designated file name.
*Example:- whereis passwd *displays the paths to the source, binary, and man pages of the passwd file.
*
which *_commandname_  - Find and display the pathname for the designated command’s executable file.
*Example:- which vi *displays the path for the vi program executable.




To be continued......


----------



## kapsicum (Jan 1, 2009)

a good thread for absolute newbie


----------



## QwertyManiac (Jan 2, 2009)

Hmpfh, and misc.


----------



## ambika (Jan 2, 2009)

WOW!! i have no words to thanks...........really thanks.
Can u add little more ..........1.root account....and 2.shell script.


----------



## NucleusKore (Jan 2, 2009)

Good effort


----------



## piyushp_20 (Jan 2, 2009)

Thanx a lot for reading this...
i am constantly working on this starter guide and will update it regularly..

my basic aim with this is to help as many people as i can to switch to Linux..



ambika said:


> WOW!! i have no words to thanks...........really thanks.
> Can u add little more ..........1.root account....and 2.shell script.



i will be posting on them very soon.... the work is on final stage..


----------



## Rahim (Jan 2, 2009)

The biggest problem with new user is that THEY DONT SEARCH THE FORUM AT ALL (main uunchii aawaaz mein baat karta hoon  )

IF only they can read the stickies, we can avoid useless threads bloat.

@Piyush: Great Effort and keep adding to it.


----------



## piyushp_20 (Jan 2, 2009)

i sincerely request mods to make this thread sticky so that it reach the masses easily...


----------



## saqib_khan (Jan 2, 2009)

Nice article


----------



## piyushp_20 (Jan 3, 2009)

guyz if you also have nething interesting and want to contribute to this starter guide then please do it....


----------



## User Name (Jan 3, 2009)

Are you making this guide yourself or by referring some book. If ur using any linux guide book then plz give me the name or any link.

Good effort keep updating......


----------



## IronManForever (Jan 3, 2009)

Something you might add; the difference from, lets say, Windows. "Everything on Linux is a file" thing.


----------



## Faun (Jan 3, 2009)

Linux is as boring as other OSes...lol

But I still use it...megalol


----------



## thewisecrab (Jan 3, 2009)

Nice Guide 
I think this deserves a place in the stickied "FAQs" of Linux.


----------



## piyushp_20 (Jan 3, 2009)

User Name said:


> Are you making this guide yourself or by referring some book. If ur using any linux guide book then plz give me the name or any link.
> 
> Good effort keep updating......


buddy i am preparing for LP1 exam and for this i m reading as much as i can on linux... and this guide is a result of that knowledge...m not referring to any book as such but ya i do make sure that therz nothing left in the topic which i hvnt covered here..


----------



## User Name (Jan 3, 2009)

ok When this guide will over, Will you make PDF file of ur complete Linux Guide so as one book?
it will be useful for noob like me.


----------



## piyushp_20 (Jan 3, 2009)

i guess i'll add 4 parts to it... rest cant assure you as to when it will get over....

All the credit for this goes to webgenius
i pasted this here because to the ease-of-use for this guide

Hi guys, to make things easier for Linux noobies, I have decided to post a guide to help you choose what Linux distro to get.

Linux Distro Choosing Guide
Welcome to Linux, my friend! The Linux os' in general are very alike, and different than Microsoft. Many people have decided to move to Linux because it is more stable, and open-source. Unlike MS, Linux has many different distributions (or distros). Each distro has it's '+'s and '-'s. Here I will try to cover as many different distros as I can. 

Red Hat
Red Hat Linux is a very popular distro of Linux. It comes packaged with many different free applications for you to use, such as the Mozilla browser and Open Office (Linux alternative to the MS Office package). It also comes with a fairly easy to install system that lets you install KDE or Gnome (depending on your choice).
*
Pros: *
-Popular
-Fairly easy for the novice
-Comes with loads of Linux software

*Cons: *
-Sometimes gets too easy for the Linux guru
-Lacks a bit in mp3 and dvd media

Gentoo
Gentoo Linux is a lot harder for the noobie Linux person and is more focused on the guru group. I do not recommend this distro for noobies.

*Pros:
*-- Completely customizable distributions
-- Programs compiled optimized for your hardware
-- Excellent support from the Gentoo forums
-- Portage, my personal favorite method for managing dependencies in any distro
-- Free, as in both
-- Untainted desktop environments. You get GNOME and KDE the way they were meant to look and behave

*Cons:*
-- One of the more difficult installations of any distro I've used
-- Long compile times, especially on slower machines 
-- Lots of downloading. Broadband is more or less a necessity 
-- No "true" tech support

Slackware
Current version:
-Slackware 9.1
-Gnome  2.4
-KDE 3.1.4
Slackware is a pretty good distro, coming with the installations to install Gnome 2.4.0, or KDE 3.1.4. If you want you can easily install the 2.6.xx kernel if you like beta kernels. The installation is text-based, so some users may find it a bit hard, but if you've used FreeBSD or Debian Linux then you should be fine. Overall, it's a pretty solid Linux distro to use.

Mandrake
Current version:
-Mandrake Linux 9.2
Mandrake is an excellent distro to get started with. It has an easy installation method and is graphical. The interfaces while using Mandrake makes a Windows user comfortable. It also comes installed with many different Linux things to use, wich makes it really nice.

*Pros: *
-Easy installation for new users
-Comes pre-loaded with great software

* Cons:*
-Easy for the Linux guru
-Some of the stuff installed you don't really need

Suse
To start us off, Suse comes in two different types, professional and personal. Personal is free while professional comes with a cost. Suse pro is more business-oriented while the home edition is geared to home users. The installation is graphical, and fairly easy to do. Suse also has excellent detection rates for scanners, cameras and any external devices. It uses KDE 3.1 wich is pretty nice. It is really easy for the novice Linux person, while still challenging for gurus. Suse is probably a good distro to choose if you're totally new to Linux.

*Pros: *
-Great ease-of-use
-Easy install
-Good software

* Cons:*
-Not a ton of new features since 8.2

Debian
Debian Linux is great and a very stable linux os, but definitely not for the Linux newbie. Debian was developed 100% by volunteers and not just one company, like Suse or Red Hat. It can be sometimes very hard to use but in the end it's excellent for the Linux guru.

*Pros:*
-One of the most stable Linux distros
-Made entirely by volunteers

* Cons:*
-For the guru only
-Sometimes extremely frustrating


----------



## ThinkFree (Jan 4, 2009)

Nice compilation. But.......



> Example :- Red Hat, SUSE,* Mandrake*.





> Mandrake
> Current version:
> -Mandrake Linux 9.2
> Mandrake is an excellent distro to get started with. It has an easy installation method and is graphical. The interfaces while using Mandrake makes a Windows user comfortable. It also comes installed with many different Linux things to use, wich makes it really nice.
> ...


Mandrake is now known as Mandriva.



> Wine is the best example of the Windows Emulator.


But WINE developers say it is not an emulator. 
Debunking wine myths



> Slackware
> Current version:
> *-Slackware 9.1*
> -Gnome 2.4
> ...


Latest version is 12.2. Atleast give an warning that it's one of the toughest distro to learn. 




> Red Hat
> Red Hat Linux is a very popular distro of Linux. It comes packaged with many different free applications for you to use, such as the Mozilla browser and Open Office (Linux alternative to the MS Office package). It also comes with a fairly easy to install system that lets you install KDE or Gnome (depending on your choice).


Red Hat linux doesn't exist either. In 2004, it was divided  into Red Hat enterprise Linux and Fedora. RHEL for enterprises (paid support) and Fedora as the community version. 

Is the distro guide for new home users or students/office users. If for home users, don't suggest them RHEL or SUSE(Fedora and OpenSuse are there) . And how can you forget Ubuntu?

Also, you can add information about GRUB and LILO in bootloader, XFCE in DM, Standalone Windows managers like fluxbox etc.

__________________________________________________



> KDE (*Kommon* Desktop Environment) uses K window manager


Can someone confirm that K stands for Kommon?


----------



## piyushp_20 (Jan 4, 2009)

ooohhhhh ****... i should have read that once.. *Guyz sorry for not posting the updated distro guide* actually i just copy pasted that.. hvnt evn read once (sorry again)

@ThinkFree thanx for pointing out the mistakes and correcting them...


----------



## Naveen.S (Jan 4, 2009)

> Gentoo Cons -- No "true" tech support


Have you tried Gentoo HandBook? Gentoo Forums are one of the most active Linux forums and its IRC channel has never disappointed any one.



> Debian
> Debian Linux is great and a very stable linux os, but definitely not for the Linux newbie. Debian was developed 100% by volunteers and not just one company, like Suse or Red Hat. It can be sometimes very hard to use but in the end it's excellent for the Linux guru.
> 
> Pros:
> ...


I completely *disagree* with _Cons_ part. Debian is as user friendly as any other OS. Tons of packages in sources. Do you know that Ubuntu is Debian based only? 

I would suggest you to try those distros before posting anything. I disagree with your views regarding RedHat, Mandriva ( Mandrake ) and Suse too.

*Thinkfree* has pointed those already though.


----------



## ThinkFree (Jan 4, 2009)

ghost at rest said:


> Have you tried Gentoo HandBook? Gentoo Forums are one of the most active Linux forums and its IRC channel has never disappointed any one.



*djforum.free.fr/smileysmileysmiley/v2/surprises/surprises.smileysmiley.com.54.gif 
Though official paid support isn't there, but community support is great. But he said that he has just copy-pasted that part(which is not hard to find out reading the second guide)


----------



## Sathish (Jan 4, 2009)

today hundreds of e-books is available for linux on net from begineers level to expert level for totally free.   
if u put some links on this thread, it will make differnet..


----------



## piyushp_20 (Jan 4, 2009)

@ghost at rest buddy these were the views of *webgenius*, and i guess personal openions may vary...

i personally prefer Ubuntu for all my linux needs.....



Betruger said:


> today hundreds of e-books is available for linux on net from begineers level to expert level for totally free.
> if u put some links on this thread, it will make differnet..


thanx for the idea.... will find and post very soon.. in the meanwhile if u hv nething to post here dn plz do..


----------



## Naveen.S (Jan 4, 2009)

> @ghost at rest buddy these were the views of webgenius, and i guess personal openions may vary...


I agree that there are thousands of distros freely available to use and which one is best depends on personal likes/dislikes only. I don't want to be sound rude but there is a difference between facts and opinions. 

You have written or copy/pasted in thread to help new users. You should give correct info only. You know, as newbie, I had a lot of trouble during installation of my first Linux distro. Later, I came to know that the website/tutorials I was using were pretty old/outdated and full of misconceptions. That made my Linux journey a bit bumpy in starting.


----------



## piyushp_20 (Jan 5, 2009)

@ghost at rest ya buddy got ur point... but now u guys hv corrected the mistakes so next time i'll make sure dat such mistakes dont happen...


----------



## ThinkFree (Jan 5, 2009)

^^Even if you are 100% sure, still confirm the correctness of the content you are posting. A little mistake on part of you might give a large amount of trouble to a newbie.


----------



## piyushp_20 (Jan 5, 2009)

guys can u also help me build up this guide by jst telling me the essential topics which i have not covered yet.... i will be posting for shell script and package management.. and that it from my side.....
waiting 4 ur rply guyz..


----------



## QwertyManiac (Jan 5, 2009)

You still would like to persist that all of the above are not from various other sources, and are works of your own? :\


----------



## piyushp_20 (Jan 5, 2009)

@QwertyManiac buddy, i have answered to similar question before also, (see reply #15)... i am not saying i have created all the commands and developed linux... m just summing up whatever i know about it...


----------



## ThinkFree (Jan 6, 2009)

> NOTE:- please make sure that linux is case sensitive, even spaces matter.


Are you sure you meant that? Seems you are telling how to develop an OS.



> *Ls –*a - View a listing of all files, including hidden files.
> *Ls –*aR - View a listing of files, including hidden files, and including files in all subdirectories (recursive)..


Linux is case sensitive and no Ls command is there.


----------



## piyushp_20 (Jan 6, 2009)

ThinkFree said:


> Are you sure you meant that? Seems you are telling how to develop an OS.
> Linux is case sensitive and no Ls command is there.



Thanx for pointing out that... i guess this was Open Office error (mine too)... btw edited it...


----------



## piyushp_20 (Jan 10, 2009)

guyz i will b posting *shell script introduction after 28th of jan* as m hving my sem end exams...


----------

