Linux Guide

  1. Linux OS
  2. File System
  3. Processes
  4. Programming Languages
  5. XWindows
  6. Gnome
  7. Games
  8. Networking
  9. bash
  10. Shell Programming

I. The Linux OS

a. History of Linux

Linux was developed in the late 1980s by Linus Torvalds, a Finnish student who could not afford a Unix machine. He developed Linux as a free clone of Unix, with an open source model of source code so that other poor students like him would be able to have an OS.

Over time, several several variants of Linux have developed, all of which are available for free download via their websites :

Several varieties of Unix exist, including IBM AIX, Sun Solaris OS, HP-UX, etc.

b. Advantages of Linux

c. OS Holy War

Linux and Unix dominate the server market :

O/S
Server Market Share
Windows NT
36 %
Linux
24 %
NetWare
19 %
Unix
15 %
Host/Server
3 %
Other
3 %

Table: Server Market 1999 (5.7 million shipments)
IDC, IT Forecaster, August 8, 2000

As per ComputerUser.com, "Linux is the leading choice for Web deployment, powering 30 percent of all public Web sites, according to a study conducted last May [1999] by Netcraft, Inc.."

Google is powered by linux servers: "Google, based in Mountain View, Calif., relies on more that 4,000 Apache Web servers running Linux to drive its wildly successful search engine technology, incorporated into the Net initiatives of companies like Palm Inc., Cisco Systems, Hungry Minds.com, and the Washington Post."

"Free shall make you free" was the clarion call of the original Web, Torvalds and other open-source pioneers such as Richard Stallman of the GNU project and Jon "maddog" Hall--currently executive director of Linux International--heard that message, tirelessly promoting it in the burgeoning Web community.

2000
2003 (projected)
O/S
Machines
O/S
Machines
Linux
15 million
Linux
30 million
Unix
4.5 million
Unix
4.8 million
Table: User Base
`Unix vs. Linux,' Dan Blacharski, Computer User, Dec. 2000 (IDC)

Linux is thus outpacing Unix, and is arising as a serious competitor to Microsoft in the client desktop programming market. By comparison, NT user base is 2 - 4 million and the Mac user base is 22 million 50 million units of Windows 3.1 and 3.11 have been installed as per microsoft.com. Prior to Win 95 launch [ 1995 ], there was a user base of 50 million Win 3.x users

O/S
Client Market Share
MicroSoft
87.7 %
Linux
4.1 %
Mac OS
5.0 %
Other
3.8 %

Table: Client/Desktop Market (98.8 million shipments)
IDC, Press Release 07/17/00

Linux has been branded as the number one threat to Microsoft's dominance of the client market. An `OS Holy War' has thus broken out.


The OS Holy War on Rediff, http://www.rediff.com/computer/dgos.htm

d. Restricted User Priveleges

Linux does not give all users the same priveleges. Users only have access to their own files, while certain group members have access to group files; the root or superuser has priveleged access to all files. Thus, the spread of viruses is inhibited.

Users should choose difficult to choose passwords, which are not dictionary words and including special characters.

Login is accomplished by entering a valid user name and password. Commands in Linux have command-line options (preceded by a -).

Basic User commands: Try these basic commands after logging in:

Further information about a particular command can be obtained from the in-built system manuals :

II. File System

a. Editing Files

b. Listing and Viewing Files

c. Formatting Files

d. Directories

e. Finding and Searching Files

f. File Permissions

g. Compressing Files

h. Root File System

Directory
Purpose
  / Root Directory
  /home Holds Users' Home directories, in many LINUX systems this is /usr, /users or /u
  /bin Binaries Directory, containing files that are executable which only computers could understand.
  /usr Holds user-oriented directories
  /usr/bin User-oriented Linux programs
  /var Subdirectories: mail holds mail files, spool holds files to be printed, and uucp holds files copied between Linux machines.
  /dev Device Files. These are special files that serve as gateways to physical computer components.
  /etc Etcetera: Linux Configuration Files.
  /sbin System Binaries usually run automatically by the Linux system.

III. Processes

a. Process Commands

IV. Programming Languages

a. Compilers

b. Mathematical Aids

V. X Windows

a. Initialization

b. Commands

Games which can be started from the command prompt in xwindows: xevil, xdino, battlestar, atc, trek, robots, worm, doom, etc. cf. /usr/x11/bin

Desktop can be changed using Gnome Footprint | Programs | System | Desktop Switching Tool. To make the Taskbar visible, please click on the K Menu icon on the K Panel. Next, click on Settings > Applications > Panel. Then in the K Panel Configuration pop-up box, please move the dot under Taskbar from Hidden to Bottom by clicking on Bottom. Please see Figure 4 (above) and Figure 5 (below).

VI. Gnome

x. AbiWord ( MS Word clone )

x. GIMP   (`gnome image manipulation program', a free replacement of Adobe Photoshop )

x. Gnome-DB   (`gnome database')

x. Guppi   (`graphing and plotting program')

x. Dia   (`Diagram')

x. OpenWriter   (OpenOffice wordprocessor.)

Sun is integrating their OpenOffice Suite with GNOME, which means all the applications of OpenOffice will become part of GNOME Office.

x. StarOffice   (`Sun Office suite')

VII. Games

Not all of these games may be present on the particular linux installation, all however can be downloaded for free from various websites.

a. Adventure and Text Games

b. War Games

c. Board Games

d. Video Games

e. Card Games

VIII. Networking

a. E-Mail

b. Chatting

c. Telnet

To telnet to another machine, use the hostname $telnet mars or the IP address, $telnet 198.100.11.15 and then supply required username and password.

Use netstat to check on network peroformance.

d. ftp

To use ftp services use the hostname $ftp venus.ensindia.com or use the IP address $ftp 198.100.11.15, supplying required username and password.

The following commands are used to retrieve files:

e. www

f. Other Commands: rlogin, ping, traceroute

IX. bash (Bourne Again Shell)

Definition of Shell : - Program layer providing a human interface point and user environment for communication with the Linux kernel

a. Features of bash

b. Shell Initialization and De-Initialization

  1. /etc/profile is the default initialization file.
  2. ~/.bash_profile
    ~/.bash_login
    ~/.profile   (bash searches for the first of these files and executes them; ~/.bashrc is often made to point to any of these so as to permit non-interactive login initialization)
  3. ~/.bash_logout   (executed on logout)
  4. ~/.bashrc(subshell or non-login shell initialization file)

c. Shell Environment Variables

Using $export causes the value of a variable to be made visible to all subprocesses that belong to the current shell.

d. Shell Meta-Characters

The following are shell meta-characters, also known as wildcards: The following are important shell symbols:

X. Shell Programming

a. Basic Shell Scripts

  1. Write the Shell Progam using an editor like pico or vi:

    hello.sh

    echo "Hello World"
    echo "From Samarstan"
    

  2. Execute Permission is to be granted : $chmod 755 hello.sh     if this is not done, "Permission denied" will be echoed once the script is executed.

  3. Execution of the Shell Script : Execute the script as if it were a command, giving its full path name, eg.
    $./hello.sh       where ./ refers to the present directory, or
    $bash hello.sh   or
    $"`pwd`/hello.sh"       where pwd returns the present working directory, or
    $set `pwd`=$PWD; $PWD/hello.sh   or
    $ ~/dir/subdir/hello.sh   using the full path name. In all cases, you should see "Hello World From Samarstan" printed to the screen.
basic.sh

#! /bin/bash
who
echo '******************'
ls
echo "******************"
# This is a comment
ps
echo '******************'

It is often customary to write the shell at the top of the script, as in #! /bin/bash , and # lines are comments.

b. Quotation Marks

The double quotation marks (""), the single quotation marks (''), and the backslash (\) are all used to hide special characters from the shell.

logname.sh

echo '******************'
echo "hello $LOGNAME"
echo "******************"

Note that using echo 'hello $LOGNAME' would not work, returning "hello there $LOGNAME" as the single quotes would hide the variable from the shell.

c. Variables

d. Conditional Statements

References