Saturday, 5 July 2014

FILESYSTEM HIERARCHY SYSTEM

FILESYSTEM HIERARCHY SYSTEM

Linux uses single rooted, inverted tree like file system hierarchy

/    This is top level directory
It is parent directory for all other directories
It is called as ROOT directory
It is represented by forward slash (/)

C:\ of windows

/root  it is home directory for root user (super user)
It provides working environment for root user
C:\Documents and Settings\Administrator

/home it is home directory for other users
It provide working environment for other users (other than root)
c:\Documents and Settings\username

/boot it contains bootable files for Linux
Like vmlinuz (kernel)..... ntoskrnl
Initrd (INITial Ram Disk)and
GRUB (GRand Unified Boot loader).... boot.ini, ntldr

/etc it contains all configuration files
Like /etc/passwd..... User info
/etc/resolv.conf... Preferred DNS
/etc/dhcpd.conf.... DH

/usr by default soft wares are installed in /usr directory
(UNIX Sharable Resources)
c:\program files

/opt It is optional directory for /usr
It contains third party softwares
c:\program files

/bin it contains commands used by all users
(Binary files)

/sbin it contains commands used by only Super User (root)
(Super user's binary files)

/dev it contains device files
Like /dev/hda ... for hard disk
/dev/cd rom ... for cd rom
Similar to device manager of windows

/proc it contain process files
Its contents are not permanent, they keep changing
It is also called as Virtual Directory
Its file contain useful information used by OS
like /proc/meminfo ... information of RAM/SWAP
/proc/cpuinfo ... information of CPU

/var it is containing variable data like mails, log files

/mnt it is default mount point for any partition
It is empty by default

/media it contains all of removable media like CD-ROM, pen drive

/lib it contains library files which are used by OS
It is similar to dll files of windows
Library files in Linux are SO (shared object) files


ARCHITECTURE OF UNIX

ARCHITECTURE OF UNIX

The architecture of UNIX can be divided into three levels of functionality, as shown in Figure . The lowest level is the kernel , which schedules tasks , manages resources, and controls security. The next level is the shell, which acts as the user interface, interpreting user commands and starting applications. The highest level is utilities, which provides utility functions. In other words it is the USER level, as user is the one who operates those utilities.




Linux Origins

Linux Origins


  • LINUS TORVALDS


  1. Finnish college student in 1991
  2. Created Linux Kernel


  • When Linux Kernel combined with GNU applications, complete free UNIX like OS was developed.
  • Why Linux?
  • Fresh implementation of UNIX APIs
  • Open source development model
  • Supports wide variety of hardware
  • Supports many networking protocols and Configurations
  • Fully supported


  1.  Linux is a UNIX like OS: Linux is a similar to UNIX as the various UNIX versions are to each other.
  2.  Multi-User and Multi-tasking: Linux is a multi-user and multi-tasking operating system. That means that more than one person can be logged on to the same Linux computer at the same time. The same user could even be logged into their account from two or more terminals at the same time; Linux is also Multi-Tasking. A user can have more than one program executing at the same time.
  3. Wide hardware support: Red Hat Linux support most pieces modern x86 compatible PC hardware.
  4.  Fully Supported: Red Hat Linux is a fully supported distribution Red Hat Inc. provides many support programs for the smallest to the largest companies.

HISTORY OF UNIX

In the beginning, there was AT&T.

Bell Labs’ Ken Thompson developed UNIX in 1969 so he could play games on a scavenged DEC PDP-7. With the help of Dennis Ritchie, the inventor of the “C” programing language, Ken rewrote UNIX entirely in “C” so that it could be used on different computers. In 1974, the OS was licensed to universities for educational purposes. Over the years, hundreds of people added and improved upon the system, and it spread into the commercial world. Dozens of different UNIX “flavors” appeared, each with unique qualities, yet still having enough similarities to the original AT&T version. All of the “flavors” were based on either AT&T’s System V or Berkeley System Distribution (BSD) UNIX, or a hybrid of both.

During the late 1980’s there were several of commercial implementations of UNIX:


  • Apple Computer’s A/UX
  • AT&T’s System V Release 3
  • Digital Equipment Corporation’s Ultrix and OSF/1 (renamed to DEC UNIX)
  • Hewlett Packard’s HP-UX
  • IBM’s AIX
  • Lynx’s Real-Time UNIX
  • NeXT’s NeXTStep
  • Santa Cruz Operation’s SCO UNIX
  • Silicon Graphics’ IRIX
  • SUN Microsystems’ SUN OS and Solaris
  • and dozens more.


The Open Standards Foundation is a UNIX industry organization designed to keep the various UNIX flavors working together. They created operating systems guidelines called POSIX to encourage inter-operability of applications from one flavor of UNIX to another. Portability of applications to different gave UNIX a distinct advantage over its mainframe competition.

Then came the GUIs. Apple’s Macintosh operating system and Microsoft’s Windows operating environment simplified computing tasks, and made computers more appealing to a larger number of users. UNIX wizards enjoyed the power of the command line interface, but acknowledged the difficult learning curve for new users. The Athena Project at MIT developed the X Windows Graphical User Interface for UNIX computers. Also known as the X11 environment, corporations developed their own “flavors” of the UNIX GUIs based on X11. Eventually, a GUI standard called Motif was generally accepted by the corporations and academia.

During the late 1990’s Microsoft’s Windows NT operating system started encroaching into traditional UNIX businesses such as banking and high-end graphics. Although not as reliable as UNIX, NT became popular because of the lower learning curve and its similarities to Windows 95 and 98. Many traditional
UNIX companies, such as DEC and Silicon Graphics, abandoned their OS for NT. Others, such as SUN, focused their efforts on niche markets, such as the Internet.

Linus Torvalds had a dream. He wanted to create the coolest operating system in the world that was free for anyone to use and modify. Based on an obscure UNIX flavor called MINIX, Linus took the source code and created his own flavor, called Linux. Using the power of the Internet, he distributed copies of his OS all over the world, and fellow programmers improved upon his work. In 1999, with a dozen versions of the OS and many GUIs to choose from, Linux is causing a UNIX revival. Knowing that people are used to the Windows tools, Linux developers are making applications that combine the best of Windows with the best of UNIX.

UNIX Principles


  • Everything is a file:- UNIX system have many powerful utilities designed to create and manipulate files. The UNIX security model is based around the security of files. By treating everything as a file, you can secure access to hardware in the same way as you secure access to a document.
  • Configuration data stored in text: - Storing configuration in text allows an administrator to move a configuration from one machine to another easily, provide the ability to roll back a system configuration to a particular date and time.
  • Small, Single-Purpose Programs: - UNIX provides many utilities.
  • Avoid captive user interfaces:-
  • Ability to chain programs together to perform complex tasks:- A core design feature of UNIX is that output of one program can be the input for another. This gives the user the flexibility to combine many small programs together to perform a larger, more complex task.


GNU Project/ FSF


  • GNU project started in 1984


  1. Goal: Create ‘free’ UNIX clone
  2. By 1990, nearly all required user space application created. Example:-gcc, emacs, etc.


  • Free Software Foundation
  1. Non-Profit organization that manages the GNU project.


GPL – GNU (General Public License)


  • primary license for open source software
  • encourages free software
  • All enhancements and changes to GPL software must also be GPL
  • Often called ‘copy left’ (All rights reversed)

INTRODUCTION TO LINUX


What is Operating System ?

Operating system is an interface between user and the computer hardware. The hardware of the computer cannot understand the human readable language as it works on binaries i.e. 0's and 1's. Also it is very tough for humans to understand the binary language, in such case we need an interface which can translate human language to hardware and vice-versa for effective communication