Explore

Loading

Wednesday, February 8, 2012

Why have multiple partitions?

  • Reduce the risk of system failure in case a partition becomes full. Runaway processes or maniacal users can consume so much disk space that the operating system no longer has room on the hard drive for its bookkeeping operations. This will lead to disaster. By segregating space, you ensure that things other than the operating system die when allocated disk space is exhausted.
     
  • Encapsulate your data. Since file system corruption is local to a partition, you stand to lose only some of your data if an accident occurs.

What is a Partition?


  • Partitioning is a means to divide a single hard drive into many logical drives.
  • A partition is a contiguous set of blocks on a drive that are treated as an independent disk.
  • A partition table is an index that relates sections of the hard drive to partitions.

Tuesday, February 7, 2012

Red Hat Package Manager

  • Enables a user to build and query software packages
  • Allows the system administrator to install, update, erase and build packages
  • Checks for required disk space and dependencies when installing a package
  • RPM package names are of the format package –version-build.architecture.rpm
    Eg: xfm-1.3.2-13.i386.rpm
  • Use rpm –ivh package name to install the packageIf the package is already installed, or if package that depends on are not installed, RPM will show an error message

Linux Today

Linux has been used for many computing platforms
PC, PDA, Supercomputer,…
Current kernel version 2.4.20. 2.5 is coming
Not only character user interface but graphical user interface, thanks to the X-Window technology
Commercial vendors moved in Linux itself to provide freely distributed code. They make their money by compiling up various software and gathering them in a distributable format
Red Hat, Slackware, etc
Chinese distribution of Linux also appeared in Taiwan and China - CLE, Red Flag Linux

A Development of Linux

  • UNIX: 1969 Thompson & Ritchie AT&T Bell Labs
  • BSD: 1978 Berkeley Software Distribution
  • Commercial Vendors: Sun, HP, IBM, SGI, DEC
  • GNU: 1984 Richard Stallman, FSF
  • POSIX: 1986 IEEE Portable Operating System unIX
  • Minix: 1987 Andy Tannenbaum
  • SVR4:  1989 AT&T and Sun
  • Linux: 1991 Linus Torvalds Intel 386 (i386)
  • Open Source: GPL, LGPL, Cathedral and the Bazaar

 GNU project
Established in 1984 by Richard Stallman, who believes that software should be free from restrictions against copying or modification in order to make better and efficient computer programs
GNU is a recursive acronym for “GNU's Not Unix”
Aim at developing a complete Unix-like operating system which is free for copying and modification
Companies make their money by maintaining and distributing the software, e.g. optimally packaging the software with different tools (Redhat, Slackware, Mandrake, SuSE, etc)
Stallman built the first free GNU C Compiler in 1991. But still, an OS was yet to be developed



Features of Modern OS


•Provide a user interface
•Organize files on disk
•Allocating resource to different users with security control
•Co-ordinate programs to work with devices and other programs

Monday, February 6, 2012

VI editor


Linux VI Editor

VI Commands:
i

insert mode, (ESC to exit insert mode) allows text to be entered on the screen
a

Append to right mode
/word

Move to the occurrence of "word"
n

Locate the next occurance
w

Advance to the next word
e

Advance to the next end of a word
b

Move to the previous word
3b

Move backward 3 words
dd

delete line
3dd

delete 3 lines
D

Delete remainder of a line
dw

Delete word
x

Delete character
o

Open space for new line below the cursor line
O

Open a line above the cursor
CTRL-w

Move back a word in append mode
u

Undo last
U

Undo all changes to current line
.

In command mode, repeat the last text changing the command on the current line
:w newfilename

save the file to newfilename from the command mode
:wq

save and quit
:q!

quit without saving
r

replace then typa a character ot be replaced with r then return to break up a line
J

join 2 lines
s

substitute (sentence) typed text over a character, ESC when done
cw

change word
c

change part of a line from the cursor to the end of the line
cc

substitute new text for aline, ESC when done
h

move the cursor back one space
H

move the cursor to the highest line on the screen
L

move the cursor to the lowest line on the screen
M

position the cursor at the midpoint on the screen
G

last line in the file
0 (zero)

Move the cursor to the beginning of the line it is on
view filename

Open a file for viewing only
set number

Turn on line numbers
set nonumber

Turn off line numbers
Options:


number


autoindent (ai)

ctrl-d to move to the left
showmatch

match brackets and parenthesis
tabstop=4


wrapmargine(wm)

when line is wrapped (80-value)
:2 copy 4

Place a copy of line 2 after line 4.
:1,4

copy 7 (lines 1-4)
:n

Access the next file for editing

Shell scripts are set of commands that are executed using a single filename.They can be created using one of the editor(vi) or the cat command.Editors help in creating and editing files.Linux offers various types of editors like vi(full screen editor),ex(line editor),sed,ed…etc.Vi stands for visual.