introduction to linux operating system basic information

DILEEPSADHANKAR 107 views 48 slides Mar 15, 2024
Slide 1
Slide 1 of 48
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48

About This Presentation

Logging In and Logging Out, Anatomy of Linux OS, Directory
Structure, /usr Directory
File Types: User data files, System data files, Executable files. Naming
files and directories, Spawning Processes.
Shell: Creating User Account, Shell Program, bash shell, Changing shell
prompt.


Slide Content

B.Sc. Part II Semester IV
(Paper II)
LINUX OPERATING SYSTEM
1
Dr. Dileep Sadhankar,
St. Francis De Sales College, Nagpur

UNIT -I :
LoggingInandLoggingOut,AnatomyofLinuxOS,Directory
Structure,/usrDirectory
FileTypes:Userdatafiles,Systemdatafiles,Executablefiles.Naming
filesanddirectories,SpawningProcesses.
Shell:CreatingUserAccount,ShellProgram,bashshell,Changingshell
prompt.
Commands:BasicSyntaxforacommand,ExploringtheHome
Directory,ls,mkdir,rmdir,stat,cat,rm,mv,cp
2
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

ExplaintheprocessoflogginginandloggingoutinLinuxoperatingsystem.
Whenwebootthesystem,loginpromptappearswherewehavetotypeauniquenamethat
identifiesasanauthorizeduseronthesystem.
DependingonthedistributioninstalledandhowtheXwindowsystemisset,thelogin
prompttakesvariousshapesandforms.
ifweinstalledLinuxMandrakeand
electednottostarttheXwindowsystem
whenthesystemboots,theloginprompt
andassociatedlateofinformationmight
lookasshownbelow:
3
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

INTRODUCTION
LinuxisaUnixclone.
Itcanrunon32/64bithardware.ItCanaddressupto64GBRAM.
Linuxistruemultitaskingenvironment.
LinuxwascreatedbyLinusTorvaldsin1991,andithasbeendeveloped
withthehelpofmanyprogrammersacrosstheInternet
ThesourcecodeforLinuxisfreelyavailabletoeveryone.
Ithasevolvedintoaveryfunctional,powerfulandusablecloneofUnix
whichhasatleast10millionusersworldwide.
4
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

5
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

Portable:LinuxoperatingsystemcanworkondifferenttypesofhardwareaswellasLinux
kernelsupportstheinstallationofanykindofhardwareplatform.
OpenSource:SourcecodeofLINUXoperatingsystemisfreelyavailable.
Multiuser:Linuxoperatingsystemisamultiusersystem,whichmeans,multipleuserscan
accessthesystemresourceslikeRAM,MemoryorApplicationprogramsatthesametime.
Multiprogramming:Linuxoperatingsystemisamultiprogrammingsystem,whichmeans
multipleapplicationscanrunatthesametime.
HierarchicalFileSystem:Linuxoperatingsystemaffordsastandardfilestructureinwhich
systemfilesoruserfilesarearranged.
Shell:Linuxoperatingsystemoffersaspecialinterpreterprogram,thatcanbeusedtoexecute
commandsoftheOS.Itcanbeusedtodoseveraltypesofoperationslikecallapplication
programs,andsoon.
Security:Linuxoperatingsystemoffersusersecuritysystemsusingauthenticationfeatureslike
encryptionofdataorpasswordprotectionorcontrolledaccesstoparticularfiles.
6
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

Why Linux?
1.ALinuxDistributionhasthousandsofdollarsworthofsoftwarefornocost.Fullsourcecode
isprovidedandfree.
2.Linuxisacompleteoperatingsystem:
1.stable-thecrashofanapplicationismuchlesslikelytobringdowntheOSunder
Linux.
2.Reliable-Linuxserversareoftenupforhundredsofdayscomparedwiththeregular
rebootsrequiredwithaWindowssystem.
3.extremelypowerful
3.Linuxprovidesacompletedevelopmentenvironment.
4.Excellentnetworkingfacilities
5.Idealenvironmenttorunserverssuchasawebserver,oranftpserver.
6.AwidevarietyofcommercialsoftwareisavailableifnotsatisfiedbythefreesoftwareEasily
upgradeable.
7.Supportsmultipleprocessors.
8.Truemulti-tasking,multi-userOS.
9.AnexcellentwindowsystemcalledX,theequivalentofWindowsbutmuchmoreflexible.
7
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

Loggingininvolvessupplyingausernameandapassword,whichLinuxverifiesto
determinewhethertheuserhastheauthoritytoaccessthecomputersystem.
Whentheloginscreenappears,firsttypetheusernameassignedandthenpress
enter.
Youwillbeaskedforthepassword.Noticethatyoudonotseethepasswordasyou
type.
Afteryouhavetypedpasswordpressenter.Nowyouarereadytostartexploring.
Theloginsessionforregularuseraccountisshownbelow:
localhost login: sfsuser1
Password :
[sfsuser1@localhost sfsuser1]$
8
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

Logginginasthesuperuser.
Thesuperuserhasunrestrictedaccesstotheentireoperatingsystem(hehasaccessto
everyfileandeverycommand).Onlythesuperusercanchangethesystemsetupand
configuration.
Therearetwowaystoworkasthesuperuser.
1)Logintotherootaccountdirectly.Thatistypetheusernamerootandthengivethe
passwordfortherootaccount
2)Temporarilyswitchtothesuperuseraccountwhileworkinginuseraccount.This
involvesexecutingSucommand
9
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

Exploring the Login process
Following are the steps to log in to the superuser account and your unprivileged user account.
1)Access the superuser account. At the login prompt type root and press enter. The password prompt
will appear.
2)Type the root password and press enter. The shell prompt for the root user account displays as
shown below:
[root @localhost root/ #
3)Change to a different console press Alt + F2.
4)To access your user account. At the login prompt, type the username for the unprivileged user
account and press Enter. You, will be asked for the account's password. Type the password and
press Enter
5)Temporarily change to the superuser account from the unprivileged user account. Type Su and
press Enter. You will be asked for the password for the root user account. Type the password and
press Enter. The shell prompt will look like:
[root@localhost root]#
6)Exit the superuser account: Type exit and press enter. You will be returned to your user account
and the shell prompt look like:
[sfsuser1@localhost sfsuser1]$ 10
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

Shuttingdownthesystem
Shuttingdownthesystemisajobforthesystemadministratorbecausethe
shutdowncommandcanbeexecutedonlybythesuperuseraccountfollowingare
thestepstoturnoffthecomputer.
1)Logoutofuseraccount.TypelogoutandpressEnter.
2)ReturntotheconsolewheretherootuserisloggedinpressAlt+F1.
3)Terminatethesession:Typeshutdown-hnowandpressEnter.Thesystem
willgothroughtheshutdownprocessandwillturnoffservicesandunmount
devices.
11
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

ThecenteroftheLinux
operatingsystemisthekernel.
Thekernelisapieceofsoftware
thatprovidesaninterface
betweenuser,thecomputer
hardware,and attached
peripherals.Thekernelis
responsibleformaintainingthe
filesystem, executing
commands,startingprograms,
timingsystemactivitiesand
managingsystemmemoryand
otherresources.Thefollowing
Figureshowshowthedifferent
partsofthekernelworktogether
Figure. The kernel uses several tools to help it run the operating system.
AnatomyOfTheLinuxOperatingSystem
12
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

Thekernelgivesinstructionstothesystemusingsystemcalls.
Systemcallsarecommunicationsbetweenthekernelandthedevicesit
manages,whichdirecttheperformanceofactionsrequestedbycommands
itreceivesfrominternalsystemprocessesorrunningapplications,orare
passedfromtheshell.
Thesearethevehiclesusedbythekerneltoexecuteshellcommands.The
systemcallscoordinatetheactivitiesofthekerneltoproducetheoutputfor
acommandthathasbeenexecutedbythesystemuser.
Mostimportantjobthekernelmanagethecomputer'smemoryresources.
Thememoryresourcesarerequiredtostartprocessesthatactivatedevices
andservicesandcausethecomputersystemtoperformitsjob.Allthese
happeningsaremanagedthroughthefilesystem.
13
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

Linux Directory Structure
(File System Structure)
14
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

1./(RootDirectory):EverythingonyourLinuxsystemislocatedunderthe/directory,
knownastherootdirectory..Onlyrootuserhaswriteprivilegeunderthisdirectory.
Pleasenotethat/rootisrootuser’shomedirectory,whichisnotsameas/.
2./bin(UserBinariesorprograms):Containsbinaryexecutables.CommonLinux
commandsyouneedtouseinsingle-usermodesarelocatedunderthisdirectory.
Commandsusedbyalltheusersofthesystemarelocatedhere.Forexample:ps,ls,
ping,grep,cp.
3./sbin(SystemBinaries):Justlike/bin,/sbinalsocontainsbinaryexecutables.But,the
linuxcommandslocatedunderthisdirectoryareusedtypicallybysystemaministrator,
forsystemmaintenancepurpose.Forexample:iptables,reboot,fdisk,ifconfig,swapon
4./etc(ConfigurationFiles):Containsconfigurationfilesrequiredbyallprograms.This
alsocontainsstartupandshutdownshellscriptsusedtostart/stopindividualprograms.
Forexample:/etc/resolv.conf,/etc/logrotate.conf
15
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

5./dev(DeviceFiles):Linuxexposesdevicesasfiles,andthe/devdirectorycontainsa
numberofspecialfilesthatrepresentdevices.Theseincludeterminaldevices,usb,orany
deviceattachedtothesystem.Forexample:/dev/tty1,/dev/usbmon0
6./proc(ProcessInformation):Containsinformationaboutsystemprocess.Thisisa
pseudofilesystemcontainsinformationaboutrunningprocess.Forexample:/proc/{pid}
directorycontainsinformationabouttheprocesswiththatparticularpid.Thisisavirtual
filesystemwithtextinformationaboutsystemresources.Forexample:/proc/uptime
7./var(VariableFiles):varstandsforvariablefiles.Contentofthefilesthatareexpectedto
growcanbefoundunderthisdirectory.Thisincludes—systemlogfiles(/var/log);
packagesanddatabasefiles(/var/lib);emails(/var/mail);printqueues(/var/spool);lock
files(/var/lock);tempfilesneededacrossreboots(/var/tmp);
8./tmp(TemporaryFiles):Directorythatcontainstemporaryfilescreatedbysystemand
users.Filesunderthisdirectoryaredeletedwhensystemisrebooted.
16
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

9./usr(UserPrograms):Containsbinaries,libraries,documentation,andsource-codefor
secondlevelprograms./usr/bincontainsbinaryfilesforuserprograms.Ifcan’tfinda
userbinaryunder/bin,lookunder/usr/bin.Forexample:at,awk,cc,less,scp./usr/sbin
containsbinaryfilesforsystemadministrators.Ifcan’tfindasystembinaryunder/sbin,
lookunder/usr/sbin.Forexample:atd,cron,sshd,useradd,userdel./usr/libcontains
librariesfor/usr/binand/usr/sbin./usr/localcontainsusersprogramsthatyouinstall
fromsource.Forexample,whenyouinstallapachefromsource,itgoesunder
/usr/local/apache2
10./home(HomeDirectories):Homedirectoriesforalluserstostoretheirpersonalfiles.
Forexample:/home/john,/home/nikita
11./boot(BootLoaderFiles):The/bootdirectorycontainsthefilesneededtobootthe
system.Kernelinitrd,vmlinux,grubfilesarelocatedunder/boot.Forexample:
initrd.img-2.6.32-24-generic,vmlinuz-2.6.32-24-generic
17
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

12./lib(SystemLibraries):Containslibraryfilesthatsupportsthebinarieslocatedunder/bin
and/sbin.Libraryfilenamesareeitherld*orlib*.so.*Forexample:ld-2.11.1.so,
libncurses.so.5.7
13./opt(Optionaladd-onApplications):optstandsforoptional.Containsadd-on
applicationsfromindividualvendors.add-onapplicationsshouldbeinstalledundereither
/opt/or/opt/sub-directory.
14./mnt(MountDirectory):Temporarymountdirectorywheresysadminscanmount
filesystems.
15./media(RemovableMediaDevices):The/mediadirectorycontainssubdirectorieswhere
removablemediadevicesinsertedintothecomputeraremounted.Forexamples,
/media/cdromforCD-ROM;/media/floppyforfloppydrives;/media/cdrecorderforCD
writer
16./srv(ServiceData):srvstandsforservice.Containsserverspecificservicesrelateddata.
Forexample,/srv/cvscontainsCVSrelateddata.
18
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

Types of Files in Linux
19
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

Linuxcontainsmanyfiles,eachfilledwithdifferentinformation.
Mainlytherearethreetypesoffiles:
Userdatafiles
Systemdatafiles
Executablefiles
20
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

Userdatafiles:Thesefilesarecreatedbytheuserandusuallycontainsimple
datamadeupoftextandnumbers.Filessuchas.txtfilescanbereadwitha
texteditor.Butthemorecomplexfiles,suchasthefileswhichusercreatewith
graphicsorspreadsheetprogramsrequiresaviewerorinterpreterprogramto
displaythem.
Systemdatafiles:Thesefilesareusedbytheoperatingsystemtokeeptrackof
userpasswords,logins,filepermissions,andotherthingspertainingtokeeping
thesystemrunningsmoothly.
Executablefiles:Thesefilescontaintheinstructionsthattellthecomputer
whattodo.Thesefilesareusuallycalledprograms.Whentheusergivethe
commandtothecomputer,thismeansusertellingittofollowtheinstructions
inanexecutablefile.
21
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

RulesfornamingfilesanddirectoriesinLinuxoperatingsystem
•Anysystemconfigurationfilesthatusermayeditandanyapplicationprogramsthat
usermayinstallareassignednamesandaplacewheretheyliveinthesystem.
•Userworkwiththeseapplicationsandcanaddnewfilestothefilesystemforthe
letters,reports,spreadsheets,webpagesandpicturesthathecreate.
•Tosaveadocumentforthefirsttimeuserneedstoselectadirectoryinthefile
systeminwhichtostorethefileandgivethefileaname.
Followingarethedifferentrulestostorefilesanddirectoriesintherightplace
andnamingthem.
1)Afilenameshouldnotexceed256characters.Itisnotjustthenameofthe
individualfile,itincludesthedirectorypaththatleadstothefile.Forex:The
individualfilenamedpicture.jpgthatislocatedinthe/home/sfs/images
directory.Theactualfilenameis,/home/sfs/images/picture.jpgis28characters
long. 22
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

2)Uppercaseletters(AtoZ),lowercaseletters(atoz)oranynumber(0-9)
canbeusedwhencreatingafilename.Dash(-),underscore(_)anddot
(.)canalsobeusedinfilename.
3)Donotputaspaceinthefilename.Avoidthefollowingusecharactersthat
cancauseproblemsinfilenames.
<,>,',“,#,* , | ,:, ( , ) ,^,!,\, & , ? , ^ , ~
4)Tocreatehiddenfiles,beginthefilenamewithaperiod(.).Forex:
.diary.txt
5)Typecat>practiceandpressEntertocreateafilenamedpractice.The
cursorwillmovetothenextlineonthescreen.Typefewwordsandpress
Entertomovetothenextlinepressctrl+Dtosaveandclosethefile.
6)TypecatpracticeandpressEntertoreadthefileyoujustcreated.
23
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

SPAWNINGPROCESSES
Spawnincomputingreferstoafunctionthatloadsandexecutesanew
childprocess.Thecurrentprocessmaywaitforthechildtoterminateormay
continuetoexecuteconcurrentcomputing.Creatinganewsub-process
requiresenoughmemoryinwhichboththechildprocessandthecurrent
programcanexecute.
Linuxdefinesrunningprograms,applications,utilitiesanddaemons(servers)
asprocesses.Itmaintainsavirtualfilesysteminthe/procdirectory,where
thepointerstoalltheongoingprocessesinthesystemaremaintained.
Linuxisatruemultitaskingoperatingsystem(canperformmorethanone
thingatatime).Toaccomplishthis,theLinuxkerneljustcallsupafew
daemons,andthedaemonstakeoverandperformthejob.
24
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

SPAWNINGPROCESSES
Whileaprocessisrunning,itcanspawnotherprocesses.Spawningis
accomplishedthroughtheuseofasystemcall,fork.Systemcallsare
clearlydefined,directentrypointsintothekernelthroughwhichprocesses
requestservicesfromthekernel.
Thefirststepinspawninganewprocessisforanexistingprocesstocreate
anidenticalwayofitself.Thiscopyisthentransferredintothenew
process,anditinturn,cancreateadditionalprocesses,therebyresultingon
multiplegenerationsofprocesses.(i.e.parentprocessesspawnchildren
processeswhichthenspawnsgrandchildrenprocesses).
25
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

Whatisshellprogram?
AshellprogramistheuserinterfacetothecomputersystemfortheLinux
operatingsystem.Thisinterfaceacceptscommandsfromtheuserand
translatesitintoalanguagethattheoperatingsystemcanunderstand.
Theshellcanalsobeusedtowriteprograms,automatejobcontrol,and
provideascriptingmechanismtocustomizethewaythesystemworks.
ShellprogramisoneofthemostimportantprogramsinstalledontheLinux
system.
Thefollowingfigureillustrateshowtheprocessoperatesusingshell.
26
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

27
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

Whatisbashshell?Explain.
Theshellisaprogramthattakescommandsfromthekeyboardandgives
themtotheoperatingsystemtoperform.
Bash(BourneAgainShell)isthefreeversionoftheBourne
shelldistributedwithLinuxandGNUoperatingsystems.Thebashshellis
themostwidelyusedshellinLinux.
Createdtoimproveontheearliershshell,Bashincludesfeaturesfrom
theKornshellandtheCshell.
Itoffersfunctionalimprovementsovershforbothinteractiveand
programminguse.
ThebashshellworksliketheBourneshell(sh).Thereisasymboliclink,in
the/bindirectoryofshthatpointstothebashshell.
28
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

Explaintheprocessofrunningthebashshell.
Followingarethestepstostartorrunthebashshell.
1)Displaytheshellyouareusing.ThisinformationisfoundintheSHELL
environmentvariable.
Typeecho$SHELLandpressEnter
Ifyouareusingbashshellthesystemwilldisplaythefollowing.
[sfsuser1@localhost/sfsuser1]$echo$SHELL
/bin/bash
[sfsuser1@localhost/sfsuser1]$
29
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

2)Ifyouarenotusingbash,changetothebashshell.TypebashandpressEnter.
3)Ifyouwantbashtobethedefaultshell,typechsh-5/bin/bashandpressEnter.
4)Displaythebashhelpfunction.Typehelpandpressenter.Thehelpcommand
listsallthecommandsthatarebuiltintotheshell.
[sfsuser1@localhost/sfsuser1]$helpandpressenter
30
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

Whatisshellprompt?Explain.
Theshellprompt(orcommandline)iswhereonetypescommands.When
accessingthesystemthroughatext-basedterminal,theshellisthemain
wayofaccessingprogramsanddoingworkonthesystem.Theshell
keepstrackoftheworkthatisperformedonthecomputer.
Theprompt,$,whichiscalledthecommandprompt,isissuedbythe
shell.Whilethepromptisdisplayed,youcantypeacommand.
ShellreadsyourinputafteryoupressEnter.
Thedefaultshellpromptisoftendifferentfordifferentdistributions.
Whenloggedinasroot(superuser)theshellpromptlookslike:
[root@localhostroot]#
31
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

$date ⏎
Thu Jun 25 08:30:19 MST 2009
You can customize your command prompt using the environment variable PS1
32
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

Explainthestepsofchangingtheshellprompt.
Theshellpromptcanbechangedtodisplayinformationsuchasthe
usernameforauser,thedirectoryinwhichtheuserisworking,the
currentdateandtime,oraspecialmessage.
Tochangetheshellpromptforcurrentloginsessionfollowthesteps
below:
1)Displaytheshellvariables:Attheshellprompt,typeprintenvand
pressEnter
2)Lookfortheps1variable:Theps1variableonaLinux-Mandrake
systemmightlookasfollows:
ps1=[\u@\h\w]\$
33
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

Thisvariabletellsthesystemtodisplaytheusernameforwheneverusing
thehostcomputerandthatuser'scurrentworkingdirectoryinside
bracketsfollowedbythe$prompt(or#promptforrootaccount).
3)Writedowntheinformationfromtheps1variable.
4)Changethepromptsothatitdisplaysthetime,thedate,thecurrent
workingdirectory,andthe$prompt.
Typeps1=“[\t\d\w]\$”andpressEnter.
Theshellpromptwillchangetodisplaythefollowing:
[09:55:33ThuFeb11sfsuser1]$
34
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

CharacterDescription
\! Displays the number used in the history list to access the command that will be
executed at the shell prompt.
\$ Displays a $ in the prompt for regular users and a # for the super user.
\\ Displays the backslash character
\d Display the current date.
\h Displays the hostname of the computer at which the user is working
\s Displays the name of the shell in which user
\t Display the current time
\u Displays the username of the user who is logged in to the system.
\w Displays the current working directory.
\xxx Displays any special comments (replace xxx with your text)
Following table shows the character codes that can be used to customize the shell prompt.
35
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

Whatiscommand?ExplainthebasicsyntaxforacommandLinux
operatingsystem.
ThecommandscanbeusedtomanagetheLinuxsystemandthesecommands
canbemodifiedtobehavetheway,theuserwant,alsocanbemodifiedto
performtasksinadditiontothedefaultactionsofthecommand.
Thesemodificationscantaketheformofacommandoption,aparameter,an
input/outputredirection,orapipe.
Afterdiscovering,howalltheseelementsworktogetheronthecommand
line,theusercanuseanyLinuxcommand
36
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

TheBasicsyntaxforacommand.
Followingisthebasicsyntaxforacommand.
Commandname-options[Parameter]
Commandistypedaftertheshellprompt.Toexecutethecommandpress
Enter.
Forex:ls-1/usr/doc
Thecommandusedinthisexampleisls,whichdisplaysafilelistforthe
contentsofthecurrentworkingdirectory.Thecommandoptionis-1,which
modifiestheinformationdisplayedabouteachfileinthelisting.The
parametertellsthecommandtolistthecontentsofthe/usr/docdirectory
insteadofcurrentworkingdirectory.
37
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

ExplainthestepsofcreatingtemporaryuseraccountinLinuxoperating
system.
WhentheLinuxisinstalled,asuperuser(orrootuser)accountandpossibly
oneunprivilegeduseraccountiscreated.
ButifduringtheinstallationofLinuxoperatingsystemanaccountfor
unprivilegeduseraccountisnotcreatedthenusethefollowingstepstocreateit.
1)Selecttheusername:Usernameshouldnotbemorethaneightcharacters.
Tomakethejobofthesystemadministratorsimpler,uselowercaseletters
forusername.Forex.:sfsuser1
38
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

2)Choose password: A password should be at least eight characters long.
Use upper case letters, lowercase letters and numbers to create password.
3)Log in as superuser: Type username rootand press .Type password and
press Enter. The shell prompt for the superuser account appears shown
below..
[root@localhost/root]#
4)Create the user account: At the shell prompt, type adduser sfsuser1 and
press Enter. For ex:
[root@localhost/root]# adduser sfsuser1
[root@localhost/root]#
39
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

5)Assign the password to the account: Type passwd sfsuser1 and press Enter.
[root@localhost/root]# passwd sfsuser1
Changing password for sfsuser1
Enter new password:
Type password and press Enter
The system displays the following message
Retype new password:
Passwd: all authentication tokens updated successfully
[root@localhost/root]#
40
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

6)Switchtonewterminal:Insteadofloggingoutofthesuperuseraccountto
gettouseraccount,pressALT+F2todisplaynewterminalwindow.To
returntosuperuseraccountpressALT+F1.
7)Logintouseraccount:Attheloginprompttypeusernameandpress
Enter.TypethepasswordandpressEnter.Theshellpromptappearsas
shownbelow:
[sfsuser1@localhost/sfsuser1]$
41
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

Anatomy of Linux OS
42
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

Figure: Anatomy of Linux operating System
43
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

Linuxbasedsystemcomprisesofseveralparts.Theseare:
•TheKernel
•SystemLibraries
•CommandShellandcommandlineutilities
•GraphicalUserInterfaces
44
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

TheKernel:
Thekernelistheheartoftheoperatingsystem.
Linuxkerneliswhatiscalledasa“monolithickernel”,whichmeansthatallthe
corekernelfunctionsandanyhardwaredrivermodulesarebuildintoasingle
executablewhichisthenexecutedinwhatisknownas“kernelspace”,which
meansithasfullprivilegedaccesstotheunderlyinghardware.
TheLinuxkernelprovidesanabstractionofthehardware,alongwithasetof
operationsknownas“systemcalls”.
System Libraries:
•The“libraries”areacollectionofcomputercodethatprovideawayofdoing
commontasks,suchasreadingorwritingafromafile,oropeninganetwork
connection,andtheseareusedtomakeprogrammingsimplerandtoensurethatall
programswhichuseaparticularlibraryinterfacewiththekernelandother
programsthesameway.
45
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

CommandShellandcommandlineutilities
Theshellisaninterfacebetweentheuserandthekernel.Ittakescommandsfromthe
userandexecuteskernel’sfunctions.Thisincludesthingslikethingslikemountandun-
mountfilesystems,listandaccesscontentsofafilesystems,startandstopprocesses,
loadandunloadkerneldrivermodules,andmanyothertasks.
TheShellareclassifiedintotwotypes:commandlineshellsandgraphicalshells.The
commandlineshellsprovideacommandlineinterface,whilethegraphicallineshells
provideagraphicaluserinterface.Thoughbothshellsperformoperations,butthe
graphicaluserinterfaceshellsperformslowerthanthecommandlineinterfaceshells.
Typesofshellsareclassifiedintofour:
Kornshell
Bourneshell
Cshell
46
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

GraphicalUserInterfaces:
ThevariousgraphicaluserinterfacesthatarepossibleonasystemLinuxcomewitha
suiteofapplicationsandutilitiestomakethesystemlookmuchprettier,more
functional,orsimplyeasiertouse.
The“Xwindowssystem”isthemostcommonlyusedgraphicaluserinterfacesystem
providedbyvariousLinuxdistributions,anditismostcommonlyinstalledonLinux
baseddesktopsandlaptops.
47
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur

https://bellard.org/jslinux/vm.html?url=alpine-
x86.cfg&mem=192
48
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur