Linux Shell Scripting

Unformatted text preview:

Linux Basics Shell Scripting Linux is Open Source Operating system developed by a Finnish student LinuS Torvalds in 1991 Linux Introduction It is free to download and use Linux is more reliable Linux is compatible on many h w like Macs Mainframes super computers cell phones etc Very resistant to malware such as viruses spyware etc What is Operating System Operating system is the software which acts as the interface between the hardware and the software we want to run on the hardware Ex Microsoft office is the software Microsoft windows is operating system Laptop desktop is hardware Ex Mobile is hardware Examples of mobile hardware Symbiosis Ios android is OS Application is the software Unix was developed in 1970 by Denis retchi at Bell labs Linux was developed by Linux torwalds in the year 1990 Unix vs Linux Unix is called mother of OS which laid foundation to Linux Unix is designed mainly for mainframes and is in enterprises Linux is for computer users developers servers Linux is free Unix is not Unix runs on specific hardware only AIX on IBM boxes Linux runs on many h w Linux Architecture Linux has H w includes HDD RAM CPU Kernel Heart of OS talks to H w provides low level services to upper layer components Shell interface between Kernel and user Applications Utilities provide most of functions to users Shell Shell is the screen that user use to interact with operating system Windows shell is the GUI click on icons it is called GUI shell LUI Line User interface looks like DOS Disk Operating system prompt Type a command and hit enter Line user interface much more powerful With LUI we get prompt to work on Bash shell is the default shell in Linux ROOT Like Administrator for windows machine Highest level of user anything As root anything can be performed In Linux users will have home folders Home directory is the highest level of any user folder root user highest user root directory highest folder home directory Capitazalation Upper case and lower case letters are different Home home hOMe all are same in windows All are different in case of Linux Because each letter is ASCII character in Linux Same for username Windows is case insensitive 2 files cannot be created wth names File file Linux is case sensitive 2 files can be created with names File file Server vs Desktop Server version is stripped down version of Linux no GUI lot of other tools are not installed automatically it has what a server needs Desktop version gives GUI version of Linux looks like Windows Mac Every distro has desktop and server editions ex readhat Ubuntu etc As a desktop OS Linux is not best choice Linux is good for Server configurations For setting up for website does need to reboot often Linux Distributions People started developing their own code out of kernel developed by Linus So there are many versions of linux which is called distributions flavours Example Redhat Ubuntu Fedora Centos Google android Open source Every distribution has a different purpose Trustix linux most secure Laptop desktop Ubuntu Entreprise On servers Redhat linux customer center to support DSL very small distro 53 MB All open source software is not free usage is free support is not free Everyone is allowed to see the source code Ex mysql database They will give free software but support they will charge They get money from support Open source software can be used at home personal use at test lab But cannot be used on production server we need license to use them Linux Boot process What happens when a power button is pressed on the server laptop BIOS Basic Input Output System does POST Poweron Self Test checks whether all i o devices are working fine mouse monitor keyboard RAM HDD etc searches loads and executes boot loader program MBR Master boot record Located in the first sector of bootable disk ex dev sda or dev hda first program to be executed in Linux of 512 bytes it has 3 components 1 primary bootloader of 446 bytes 2 partition table info in next 64 bytes 3 MBR validation check in last 2 bytes So it loads and executes GRUB into memory The Master Boot Record MBR is the information in the first sector of any hard disk or diskette that identifies how and where an operating system is located so that it can be boot loaded into the computer s main storage or random access memory The Master Boot Record is also sometimes called the partition sector or the master partition table because it includes a table that locates each partition that the hard disk has been formatted into In addition to this table the MBR also includes a program that reads the boot sector record of the partition containing the operating system to be booted into RAM In turn that record contains a program that loads the rest of the operating system into RAM GRUB Grand Unified Boot loader responsible for selecting OS loads kernel into memory if multiple OS images are present one image can be chooses using GRUB GRUB displays a splash screen waits for sometime if user does not choose anything it loads default kernel Looks at etc inittab file to decide run level So it loads and executes Kernel Kernel executes init program PID 1 init Runlevel programs Basic runlevels are 0 halt 1 Single user mode 2 Multiuser without NFS 4 unused 6 reboot Run levels Run level 0 etc rc d rc0 d Run level 1 etc rc d rc1 d Run level 2 etc rc d rc2 d 3 Full multiuser mode CLI no graphics with network 5 X11 graphics multiuser mode with network Run level 3 etc rc d rc3 d Run level 4 etc rc d rc4 d Run level 5 etc rc d rc5 d Run level 6 etc rc d rc6 d Under the etc rc d rc d directories you would see programs that start with S and K Programs starts with S are used during startup S for startup Programs starts with K are used during shutdown K for kill There are numbers right next to S and K in the program names Those are the sequence number in which the programs should be started or killed Linux Installation Linux can be installed using CD USD using iso image using network installation like kickstart Or single machine can be installed using iso which can be downloaded from net Linux can be installed using iso iso international standard organization example redhat 7 3 x86 64 ga iso Directory structure dev dev sda dev sdb root tmp bin lib usr var etc home boot opt iso RHEL 7 2 x86 64 iso RHEL OS on x86 64 hardware SUSE 12 SP1 ppc64le iso SLES on ppc64le hardware Ubuntu 16 10 x86 64 iso Ubuntu on x86 64 hardware FQDN Fully qualified Domain Name ctx1p25 shortname ctx1p25 in xyz com FQDN Basic


View Full Document

Linux Shell Scripting

Download Linux Shell Scripting
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Linux Shell Scripting and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Linux Shell Scripting and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?