Write Short Note On Linux and It's History?: Linux Assignment JK-ENR-CH-1721
Write Short Note On Linux and It's History?: Linux Assignment JK-ENR-CH-1721
Write Short Note On Linux and It's History?: Linux Assignment JK-ENR-CH-1721
• Unix Expansion: In eighties, many organizations like IBM, HP and dozen other
companies started creating their own Unix. It result in a mess of Unix dialects. Then
in 1983, Richard Stallman developed GNU project with the goal to make it freely
available Unix like operating system and to be used by everyone. But his project
failed in gaining popularity. Many other Unix like operating system came into
existence but none of them was able to gain popularity.
• Linux Today: Today, supercomputers, smart phones, desktop, web servers, tablet,
laptops and home appliances like washing machines, DVD players, routers, modems,
cars, refrigerators, etc use Linux OS
Access In Linux user has access to the In windows every user won’t
source code of kernel and alter the have access to the source
code according to his need. It has its code, only members of the
own advantages like bugs in OS selected group will have
will fix at a rapid pace and access to it.
disadvantages like developers may
take advantage of any weakness in
OS if they found.
1|Page
Linux Assignment JK-ENR-CH-1721
Support Linux has support via a huge Windows has support which
community of user forums/websites is easily accessible, online
and online search. forums/ websites and it has
paid support also.
Security Linux is more secure than windows Windows is the major target
where hackers or developers of for developers of viruses and
viruses will find difficult to break malware and it is most
through Linux. vulnerable without anti-virus
software.
2|Page
Linux Assignment JK-ENR-CH-1721
BIOS
Boot Loader
- MBR
- GRUB
Kernel
Init
Runlevel scripts
BIOS
• This is the first thing which loads once you power on your machine.
• When you press the power button of the machine, CPU looks out into ROM for
further instruction.
• The ROM contains JUMP function in the form of instrucion which tells the CPU to
bring up the BIOS
• BIOS determines all the list of bootable devices available in the system.
• Prompts to select bootable device which can be Hard Disk, CD/DVD-ROM, Floppy
Drive, USB Flash Memory Stick etc (optional)
• Operating System tries to boot from Hard Disk where the MBR contains primary boot
loader.
Boot Loader
To be very brief this phase includes loading of the boot loader (MBR and GRUB/LILO) into
memory to bring up the kernel.
• It is the first sector of the Hard Disk with a size of 512 bytes.
• The first 434 - 446 bytes are the primary boot loader, 64 bytes for partition table and 6
bytes for MBR validation timestamp.
NOTE: Now MBR directly cannot load the kernel as it is unaware of the filesystem
concept and requires a boot loader with file system driver for each supported file
systems, so that they can be understood and accessed by the boot loader itself.
To overcome this situation GRUB is used with the details of the filesystem
in /boot/grub.conf and file system drivers
3|Page
Linux Assignment JK-ENR-CH-1721
GRUB stage 1:
•
The primary boot loader takes up less than 512 bytes of disk space in the MBR - too
small a space to contain the instructions necessary to load a complex operating
system.
• Instead the primary boot loader performs the function of loading either the stage 1.5
or stage 2 boot loader.
GRUB Stage 1.5:
• Stage 1 can load the stage 2 directly, but it is normally set up to load the stage 1.5.
• This can happen when the /boot partition is situated beyond the 1024 cylinder head of
the hard drive.
• GRUB Stage 1.5 is located in the first 30 KB of Hard Disk immediately after MBR
and before the first partition.
• This space is utilized to store file system drivers and modules.
• This enabled stage 1.5 to load stage 2 to load from any known location on the file
system i.e. /boot/grub
GRUB Stage 2:
• This is responsible for loading kernel from /boot/grub/grub.conf and any other
modules needed
• Loads a GUI interface i.e. splash image located at /grub/splash.xpm.gz with list of
available kernels where you can manually select the kernel or else after the default
timeout value the selected kernel will boot
Kernel
This can be considered the heart of operating system responsible for handling all system
processes.
Kernel is loaded in the following stages:
4|Page
Linux Assignment JK-ENR-CH-1721
Init Process
• Executes the system to boot into the run level as specified in /etc/inittab
Runlevel scripts
A no. of runlevel scripts are defined inside /etc/rc.d/rcx.d
• Based on the selected runlevel, the init process then executes startup scripts located in
subdirectories of the /etc/rc.d directory.
• Scripts used for runlevels 0 to 6 are located in
subdirectories /etc/rc.d/rc0.d through /etc/rc.d/rc6.d, respectively.Lastly, init runs
whatever it finds in /etc/rc.d/rc.local (regardless of run level). rc.local is rather special
in that it is executed every time that you change run levels.
Maximu Max
Maximum Maximu
Maximum filenam Allowable characters m numbe
File system pathname m file
e length in directory entries volume r of
length size
size files
32,767
In Win32 namespace: Unicode
any UTF-16 code unit characters
(case-insensitive) with each
except /\:*"?<>| as path
well as NUL component
NTFS 255 characters 16 EiB 16 EiB 232
(directory
In POSIX namespace or
: any UTF-16 code filename)
unit (case-sensitive) up to 255
except / as well characters
as NUL long[f]
No limit
XFS 255 bytes Any byte except NUL 8 EiB 8 EiB ?
defined
The cat command is short for concatenate files and the command will print the file contents
to the standard output (normally your PC screen), and cat also can be used to create file on
Linux system.
5|Page
Linux Assignment JK-ENR-CH-1721
The command above will create a file called linux-command-list and to finish your work
press Ctrl+d after the line break (press Enter key after your last line of text) to denote the end
of file. Please note that the standard symbol of redirection ' > ' (greater than) sign is
necessary to create a new file.
The example below show the cat command with the appends ' >> ' redirection symbol to add
more text to the file that we create earlier (create-linux-file.txt file).
To finish your work press Ctrl+d after the line break. The next shell prompt supposed to
appear after you press Ctrl+d key.
There is many way to display file contents in Linux system, one of the easiest and simplest
way to display the file contents is using cat command.
6|Page
Linux Assignment JK-ENR-CH-1721
Note:
• To display the file contents you don't need any redirections sign (no '>' or '>>'), just
issue the cat command and the filename of file that you wish to display.
• All the file contents display immediately after you issue the command.
• The file contents display on the line after the command, and the file content finish
before the next shell prompt.
• File comparisons
1. diff
The diff command compares files line by line. It is invoked as follows:
2. cmp
The cmp command compares two files byte by byte. If the files are different then it reports
the first byte and line number where they differ.
3. sdiff
7|Page
Linux Assignment JK-ENR-CH-1721
Editors
4. vimdiff
The vim editor lets you compare files too. Use the following command to view the
differences using a side-by-side comparison:
8|Page
Linux Assignment JK-ENR-CH-1721
9|Page
Linux Assignment JK-ENR-CH-1721
The same as above, but it also displays information of dummy file systems along with
all the file system disk usage and their memory utilization.
Have you noticed that above commands displays information in bytes, which is not
readable yet all, because we are in a habit of reading the sizes in megabytes, gigabytes
etc. as it makes very easy to understand and remember.
The df command provides an option to display sizes in Human Readable formats by
using ‘-h’ (prints the results in human readable format (e.g., 1K 2M 3G)).
10 | P a g e
Linux Assignment JK-ENR-CH-1721
There are several Linux tools for viewing/listing running processes on the system, the two
traditional and well known are ps and top commands:
1. ps Command
ps aux ->List all processes in detail running on the system, including user, Process ID (PID),
and name of process. Using this, one can view their process list and if necessary, kill
unnecessary or stalled processes.
top is a powerful tool that offers you a dynamic real-time view of a running system
11 | P a g e
Linux Assignment JK-ENR-CH-1721
Simply put, a pipe is a method of connecting the standard output of one process to
the standard input of another. They provide a method of one-way communications (hence the
term half-duplex) between processes.
A pipe is a designated in command by the vertical bar character , which is located on the
same key as the backslash on U.S keyboards. The general syntax for pipes is:
example would be listing folders in a directory by ls command, though it doesn’t produce the
result in a sorted form so we’ll pipe it with sort command.
Command:ls -all
Output:
Output:
12 | P a g e
Linux Assignment JK-ENR-CH-1721
Scheduling a program
There are basic two daemons for scheduling tasks on a Linux system:
1. at , utilizes the at daemon (atd), It’s for scheduling commands to be executed once at a
specific time.
2. corntab, utilizes the corn daemon (crond) to execute repetitive or chronic scheduled tasks.
Examples of at Command:
13 | P a g e
Linux Assignment JK-ENR-CH-1721
Syntax:
$ at 00:41
Ping www.microsoft.com
Ctrl+d
At time 00:40
At time 00:41
Syntax:
14 | P a g e
Linux Assignment JK-ENR-CH-1721
15 | P a g e