SlideShare a Scribd company logo
1 of 48
Download to read offline
B.Sc. Part II Semester IV
(Paper II)
LINUX OPERATING SYSTEM
1
Dr. Dileep Sadhankar,
St. Francis De Sales College, Nagpur
UNIT - I :
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.
Commands: Basic Syntax for a command, Exploring the Home
Directory, ls, mkdir, rmdir, stat, cat, rm, mv, cp
2
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur
Explain the process of logging in and logging out in Linux operating system.
 When we boot the system, login prompt appears where we have to type a unique name that
identifies as an authorized user on the system.
 Depending on the distribution installed and how the X window system is set, the login
prompt takes various shapes and forms.
 if we installed Linux Mandrake and
elected not to start the X window system
when the system boots, the login prompt
and associated late of information might
look as shown below:
3
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur
INTRODUCTION
 Linux is a Unix clone.
 It can run on 32/64 bit hardware. It Can address upto 64 GB RAM.
 Linux is true multitasking environment.
 Linux was created by Linus Torvalds in 1991, and it has been developed
with the help of many programmers across the Internet
 The source code for Linux is freely available to everyone.
 It has evolved into a very functional, powerful and usable clone of Unix
which has at least 10 million users worldwide.
4
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur
5
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur
 Portable: Linux operating system can work on different types of hardware as well as Linux
kernel supports the installation of any kind of hardware platform.
 Open Source: Source code of LINUX operating system is freely available.
 Multiuser: Linux operating system is a multiuser system, which means, multiple users can
access the system resources like RAM, Memory or Application programs at the same time.
 Multiprogramming: Linux operating system is a multiprogramming system, which means
multiple applications can run at the same time.
 Hierarchical File System: Linux operating system affords a standard file structure in which
system files or user files are arranged.
 Shell: Linux operating system offers a special interpreter program, that can be used to execute
commands of the OS. It can be used to do several types of operations like call application
programs, and so on.
 Security: Linux operating system offers user security systems using authentication features like
encryption of data or password protection or controlled access to particular files.
6
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur
Why Linux?
1. A Linux Distribution has thousands of dollars worth of software for no cost. Full source code
is provided and free.
2. Linux is a complete operating system:
1. stable - the crash of an application is much less likely to bring down the OS under
Linux.
2. Reliable - Linux servers are often up for hundreds of days compared with the regular
reboots required with a Windows system.
3. extremely powerful
3. Linux provides a complete development environment.
4. Excellent networking facilities
5. Ideal environment to run servers such as a web server, or an ftp server.
6. A wide variety of commercial software is available if not satisfied by the free software Easily
upgradeable.
7. Supports multiple processors.
8. True multi-tasking, multi-user OS.
9. An excellent window system called X, the equivalent of Windows but much more flexible.
7
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur
 Logging in involves supplying a username and a password, which Linux verifies to
determine whether the user has the authority to access the computer system.
 When the login screen appears, first type the username assigned and then press
enter.
 You will be asked for the password. Notice that you do not see the password as you
type.
 After you have typed password press enter. Now you are ready to start exploring.
The login session for regular user account is shown below:
localhost login : sfsuser1
Password :
[sfsuser1@localhost sfsuser1]$
8
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur
Logging in as the superuser.
The superuser has unrestricted access to the entire operating system (he has access to
every file and every command). Only the superuser can change the system setup and
configuration.
There are two ways to work as the superuser.
1) Log in to the root account directly. That is type the username root and then give the
password for the root account
2) Temporarily switch to the superuser account while working in user account. This
involves executing Su command
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
Shutting down the system
Shutting down the system is a job for the system administrator because the
shutdown command can be executed only by the superuser account following are
the steps to turn off the computer.
1) Log out of user account. Type logout and press Enter.
2) Return to the console where the root user is logged in press Alt + F1.
3) Terminate the session: Type shutdown -h now and press Enter. The system
will go through the shutdown process and will turn off services and unmount
devices.
11
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur
The center of the Linux
operating system is the kernel.
The kernel is a piece of software
that provides an interface
between user, the computer
hardware, and attached
peripherals. The kernel is
responsible for maintaining the
file system, executing
commands, starting programs,
timing system activities and
managing system memory and
other resources. The following
Figure shows how the different
parts of the kernel work together
Figure. The kernel uses several tools to help it run the operating system.
Anatomy Of The Linux Operating System
12
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur
 The kernel gives instructions to the system using system calls.
 System calls are communications between the kernel and the devices it
manages, which direct the performance of actions requested by commands
it receives from internal system processes or running applications, or are
passed from the shell.
 These are the vehicles used by the kernel to execute shell commands. The
system calls coordinate the activities of the kernel to produce the output for
a command that has been executed by the system user.
 Most important job the kernel manage the computer's memory resources.
The memory resources are required to start processes that activate devices
and services and cause the computer system to perform its job. All these
happenings are managed through the file system.
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. / (Root Directory): Everything on your Linux system is located under the / directory,
known as the root directory.. Only root user has write privilege under this directory.
Please note that /root is root user’s home directory, which is not same as /.
2. /bin (User Binaries or programs): Contains binary executables. Common Linux
commands you need to use in single-user modes are located under this directory.
Commands used by all the users of the system are located here. For example: ps, ls,
ping, grep, cp.
3. /sbin (System Binaries): Just like /bin, /sbin also contains binary executables. But, the
linux commands located under this directory are used typically by system aministrator,
for system maintenance purpose. For example: iptables, reboot, fdisk, ifconfig, swapon
4. /etc (Configuration Files): Contains configuration files required by all programs. This
also contains startup and shutdown shell scripts used to start/stop individual programs.
For example: /etc/resolv.conf, /etc/logrotate.conf 15
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur
5. /dev (Device Files): Linux exposes devices as files, and the /dev directory contains a
number of special files that represent devices. These include terminal devices, usb, or any
device attached to the system. For example: /dev/tty1, /dev/usbmon0
6. /proc (Process Information): Contains information about system process. This is a
pseudo filesystem contains information about running process. For example: /proc/{pid}
directory contains information about the process with that particular pid. This is a virtual
filesystem with text information about system resources. For example: /proc/uptime
7. /var (Variable Files): var stands for variable files. Content of the files that are expected to
grow can be found under this directory. This includes — system log files (/var/log);
packages and database files (/var/lib); emails (/var/mail); print queues (/var/spool); lock
files (/var/lock); temp files needed across reboots (/var/tmp);
8. /tmp (Temporary Files): Directory that contains temporary files created by system and
users. Files under this directory are deleted when system is rebooted.
16
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur
9. /usr (User Programs): Contains binaries, libraries, documentation, and source-code for
second level programs. /usr/bin contains binary files for user programs. If can’t find a
user binary under /bin, look under /usr/bin. For example: at, awk, cc, less, scp. /usr/sbin
contains binary files for system administrators. If can’t find a system binary under /sbin,
look under /usr/sbin. For example: atd, cron, sshd, useradd, userdel. /usr/lib contains
libraries for /usr/bin and /usr/sbin. /usr/local contains users programs that you install
from source. For example, when you install apache from source, it goes under
/usr/local/apache2
10. /home (Home Directories): Home directories for all users to store their personal files.
For example: /home/john, /home/nikita
11. /boot (Boot Loader Files): The /boot directory contains the files needed to boot the
system. Kernel initrd, vmlinux, grub files are located under /boot. For example:
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 (System Libraries): Contains library files that supports the binaries located under /bin
and /sbin. Library filenames are either ld* or lib*.so.* For example: ld-2.11.1.so,
libncurses.so.5.7
13. /opt (Optional add-on Applications): opt stands for optional. Contains add-on
applications from individual vendors. add-on applications should be installed under either
/opt/ or /opt/ sub-directory.
14. /mnt (Mount Directory): Temporary mount directory where sysadmins can mount
filesystems.
15. /media (Removable Media Devices): The /media directory contains subdirectories where
removable media devices inserted into the computer are mounted. For examples,
/media/cdrom for CD-ROM; /media/floppy for floppy drives; /media/cdrecorder for CD
writer
16. /srv (Service Data): srv stands for service. Contains server specific services related data.
For example, /srv/cvs contains CVS related data.
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
Linux contains many files, each filled with different information.
Mainly there are three types of files:
 User data files
 System data files
 Executable files
20
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur
 User data files: These files are created by the user and usually contain simple
data made up of text and numbers. Files such as .txt files can be read with a
text editor. But the more complex files, such as the files which user create with
graphics or spreadsheet programs requires a viewer or interpreter program to
display them.
 System data files: These files are used by the operating system to keep track of
user passwords, logins, file permissions, and other things pertaining to keeping
the system running smoothly.
 Executable files: These files contain the instructions that tell the computer
what to do. These files are usually called programs. When the user give the
command to the computer, this means user telling it to follow the instructions
in an executable file.
21
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur
Rules for naming files and directories in Linux operating system
• Any system configuration files that user may edit and any application programs that
user may install are assigned names and a place where they live in the system.
• User work with these applications and can add new files to the file system for the
letters, reports, spreadsheets, web pages and pictures that he create.
• To save a document for the first time user needs to select a directory in the file
system in which to store the file and give the file a name.
Following are the different rules to store files and directories in the right place
and naming them.
1) A filename should not exceed 256 characters. It is not just the name of the
individual file, it includes the directory path that leads to the file. For ex: The
individual file named picture.jpg that is located in the /home/sfs/images
directory. The actual filename is, /home/sfs/images/picture.jpg is 28 characters
long. 22
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur
2) Uppercase letters (A to Z), lowercase letters (a to z) or any number (0-9)
can be used when creating a filename. Dash (-), underscore ( _ ) and dot
(.) can also be used in filename.
3) Do not put a space in the filename. Avoid the following use characters that
can cause problems in file names.
< , > , ' , “ , # , * , | , : , ( , ) , ^ , ! ,  , & , ? , ^ , ~
4) To create hidden files, begin the filename with a period (.).For ex :
.diary.txt
5) Type cat > practice and press Enter to create a file named practice. The
cursor will move to the next line on the screen. Type few words and press
Enter to move to the next line press ctrl + D to save and close the file.
6) Type cat practice and press Enter to read the file you just created.
23
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur
SPAWNING PROCESSES
 Spawn in computing refers to a function that loads and executes a new
child process. The current process may wait for the child to terminate or may
continue to execute concurrent computing. Creating a new sub-process
requires enough memory in which both the child process and the current
program can execute.
 Linux defines running programs, applications, utilities and daemons (servers)
as processes. It maintains a virtual file system in the /proc directory, where
the pointers to all the ongoing processes in the system are maintained.
 Linux is a true multitasking operating system ( can perform more than one
thing at a time). To accomplish this, the Linux kernel just calls up a few
daemons, and the daemons take over and perform the job.
24
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur
SPAWNING PROCESSES
 While a process is running, it can spawn other processes. Spawning is
accomplished through the use of a system call, fork. System calls are
clearly defined, direct entry points into the kernel through which processes
request services from the kernel.
 The first step in spawning a new process is for an existing process to create
an identical way of itself. This copy is then transferred into the new
process, and it in turn, can create additional processes, thereby resulting on
multiple generations of processes. (i.e. parent processes spawn children
processes which then spawns grandchildren processes).
25
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur
What is shell program?
 A shell program is the user interface to the computer system for the Linux
operating system. This interface accepts commands from the user and
translates it into a language that the operating system can understand.
 The shell can also be used to write programs, automate job control, and
provide a scripting mechanism to customize the way the system works.
 Shell program is one of the most important programs installed on the Linux
system.
The following figure illustrates how the process operates using shell.
26
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur
27
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur
What is bash shell? Explain.
 The shell is a program that takes commands from the keyboard and gives
them to the operating system to perform.
 Bash (Bourne Again Shell ) is the free version of the Bourne
shell distributed with Linux and GNU operating systems. The bash shell is
the most widely used shell in Linux.
 Created to improve on the earlier sh shell, Bash includes features from
the Korn shell and the C shell.
 It offers functional improvements over sh for both interactive and
programming use.
 The bash shell works like the Bourne shell (sh). There is a symbolic link, in
the /bin directory of sh that points to the bash shell.
28
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur
Explain the process of running the bash shell.
Following are the steps to start or run the bash shell.
1) Display the shell you are using. This information is found in the SHELL
environment variable.
Type echo $SHELL and press Enter
If you are using bash shell the system will display the following.
[sfsuser1@localhost/sfsuser1]$echo $SHELL
/bin/bash
[sfsuser1@localhost/sfsuser1]$
29
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur
2) If you are not using bash, change to the bash shell. Type bash and press Enter.
3) If you want bash to be the default shell, type chsh -5/bin/bash and press Enter.
4) Display the bash help function. Type help and press enter. The help command
lists all the commands that are built into the shell.
[sfsuser1@localhost/sfsuser1]$help and press enter
30
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur
What is shell prompt? Explain.
 The shell prompt (or command line) is where one types commands. When
accessing the system through a text-based terminal, the shell is the main
way of accessing programs and doing work on the system. The shell
keeps track of the work that is performed on the computer.
 The prompt, $, which is called the command prompt, is issued by the
shell. While the prompt is displayed, you can type a command.
 Shell reads your input after you press Enter.
 The default shell prompt is often different for different distributions.
When logged in as root (superuser) the shell prompt looks like :
[root@ localhost root] #
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
Explain the steps of changing the shell prompt.
The shell prompt can be changed to display information such as the
username for a user, the directory in which the user is working, the
current date and time, or a special message.
To change the shell prompt for current login session follow the steps
below:
1) Display the shell variables: At the shell prompt, type printenv and
press Enter
2) Look for the ps1 variable: The ps1 variable on a Linux-Mandrake
system might look as follows:
ps1 = [u@hw]$
33
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur
This variable tells the system to display the username for whenever using
the host computer and that user's current working directory inside
brackets followed by the $ prompt (or # prompt for root account).
3) Write down the information from the ps1 variable.
4) Change the prompt so that it displays the time, the date, the current
working directory, and the $ prompt.
Type ps1 = “[t d w] $” and press Enter.
The shell prompt will change to display the following:
[09: 55:33 Thu Feb 11 sfsuser1] $
34
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur
Character Description
! 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
What is command? Explain the basic syntax for a command Linux
operating system.
 The commands can be used to manage the Linux system and these commands
can be modified to behave the way, the user want, also can be modified to
perform tasks in addition to the default actions of the command .
 These modifications can take the form of a command option, a parameter, an
input/output redirection, or a pipe.
 After discovering, how all these elements work together on the command
line, the user can use any Linux command
36
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur
The Basic syntax for a command.
Following is the basic syntax for a command.
Commandname -options [Parameter]
 Command is typed after the shell prompt. To execute the command press
Enter.
For ex: ls -1 /usr/doc
 The command used in this example is ls, which displays a file list for the
contents of the current working directory. The command option is -1, which
modifies the information displayed about each file in the listing. The
parameter tells the command to list the contents of the /usr/doc directory
instead of current working directory.
37
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur
Explain the steps of creating temporary user account in Linux operating
system.
When the Linux is installed, a super user (or root user) account and possibly
one unprivileged user account is created.
But if during the installation of Linux operating system an account for
unprivileged user account is not created then use the following steps to create it.
1) Select the username: Username should not be more than eight characters.
To make the job of the system administrator simpler, use lowercase letters
for username. For ex. : 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 root and 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) Switch to new terminal: Instead of logging out of the superuser account to
get to user account, press ALT + F2 to display new terminal window. To
return to superuser account press ALT +F1.
7) Log in to user account: At the login prompt type username and press
Enter. Type the password and press Enter. The shell prompt appears as
shown below:
[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
Linux based system comprises of several parts. These are:
• The Kernel
• System Libraries
• Command Shell and command line utilities
• Graphical User Interfaces
44
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur
The Kernel:
 The kernel is the heart of the operating system.
 Linux kernel is what is called as a “monolithic kernel”, which means that all the
core kernel functions and any hardware driver modules are build into a single
executable which is then executed in what is known as “kernel space”, which
means it has full privileged access to the underlying hardware.
 The Linux kernel provides an abstraction of the hardware, along with a set of
operations known as “system calls”.
System Libraries:
• The “libraries” are a collection of computer code that provide a way of doing
common tasks, such as reading or writing a from a file, or opening a network
connection, and these are used to make programming simpler and to ensure that all
programs which use a particular library interface with the kernel and other
programs the same way.
45
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur
Command Shell and command line utilities
 The shell is an interface between the user and the kernel. It takes commands from the
user and executes kernel’s functions. This includes things like things like mount and un-
mount file systems, list and access contents of a file systems, start and stop processes,
load and unload kernel driver modules, and many other tasks.
 The Shell are classified into two types: command line shells and graphical shells. The
command line shells provide a command line interface, while the graphical line shells
provide a graphical user interface. Though both shells perform operations, but the
graphical user interface shells perform slower than the command line interface shells.
Types of shells are classified into four:
 Korn shell
 Bourne shell
 C shell
46
Dr. Dileep Sadhankar, St. Francis De Sales
College, Nagpur
Graphical User Interfaces:
 The various graphical user interfaces that are possible on a system Linux come with a
suite of applications and utilities to make the system look much prettier, more
functional, or simply easier to use.
 The “X windows system” is the most commonly used graphical user interface system
provided by various Linux distributions, and it is most commonly installed on Linux
based desktops and laptops.
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

More Related Content

Similar to introduction to linux operating system basic information

LinuxOS-1 (1).ppt
LinuxOS-1 (1).pptLinuxOS-1 (1).ppt
LinuxOS-1 (1).pptSavitha74
 
Linux Operating System
Linux Operating SystemLinux Operating System
Linux Operating SystemKunalKewat1
 
linux system and network administrations
linux system and network administrationslinux system and network administrations
linux system and network administrationshaile468688
 
linux os-basics,Devops training in Hyderabad
linux os-basics,Devops training in Hyderabadlinux os-basics,Devops training in Hyderabad
linux os-basics,Devops training in HyderabadDevops Trainer
 
UNIT I LINUX.docx
UNIT I LINUX.docxUNIT I LINUX.docx
UNIT I LINUX.docxBhuvanaR13
 
Lec 01_Linux System Administration (1).pptx
Lec 01_Linux System Administration (1).pptxLec 01_Linux System Administration (1).pptx
Lec 01_Linux System Administration (1).pptxShabanaShafi3
 
Introduction to Unix operating system Chapter 1-PPT Mrs.Sowmya Jyothi
Introduction to Unix operating system Chapter 1-PPT Mrs.Sowmya JyothiIntroduction to Unix operating system Chapter 1-PPT Mrs.Sowmya Jyothi
Introduction to Unix operating system Chapter 1-PPT Mrs.Sowmya JyothiSowmya Jyothi
 
16. Computer Systems Basic Software 2
16. Computer Systems   Basic Software 216. Computer Systems   Basic Software 2
16. Computer Systems Basic Software 2New Era University
 
Unix Operating System
Unix Operating SystemUnix Operating System
Unix Operating Systemsubhsikha
 
Linux introductory-course-day-1
Linux introductory-course-day-1Linux introductory-course-day-1
Linux introductory-course-day-1Julio Pulido
 
Linux lesson
Linux lesson Linux lesson
Linux lesson mutharam
 
LinuInterviewQALinuInterviewQALinuInterv
LinuInterviewQALinuInterviewQALinuIntervLinuInterviewQALinuInterviewQALinuInterv
LinuInterviewQALinuInterviewQALinuIntervAbhishekKumar66407
 

Similar to introduction to linux operating system basic information (20)

kali linux.pptx
kali linux.pptxkali linux.pptx
kali linux.pptx
 
LinuxOS-1 (1).ppt
LinuxOS-1 (1).pptLinuxOS-1 (1).ppt
LinuxOS-1 (1).ppt
 
Linux Operating System
Linux Operating SystemLinux Operating System
Linux Operating System
 
linux system and network administrations
linux system and network administrationslinux system and network administrations
linux system and network administrations
 
linux os-basics,Devops training in Hyderabad
linux os-basics,Devops training in Hyderabadlinux os-basics,Devops training in Hyderabad
linux os-basics,Devops training in Hyderabad
 
UNIT I LINUX.docx
UNIT I LINUX.docxUNIT I LINUX.docx
UNIT I LINUX.docx
 
Unix notes
Unix notesUnix notes
Unix notes
 
Lec 01_Linux System Administration (1).pptx
Lec 01_Linux System Administration (1).pptxLec 01_Linux System Administration (1).pptx
Lec 01_Linux System Administration (1).pptx
 
Introduction to Unix operating system Chapter 1-PPT Mrs.Sowmya Jyothi
Introduction to Unix operating system Chapter 1-PPT Mrs.Sowmya JyothiIntroduction to Unix operating system Chapter 1-PPT Mrs.Sowmya Jyothi
Introduction to Unix operating system Chapter 1-PPT Mrs.Sowmya Jyothi
 
Introduction to Unix
Introduction to UnixIntroduction to Unix
Introduction to Unix
 
16. Computer Systems Basic Software 2
16. Computer Systems   Basic Software 216. Computer Systems   Basic Software 2
16. Computer Systems Basic Software 2
 
Unix Operating System
Unix Operating SystemUnix Operating System
Unix Operating System
 
Ch1 linux basics
Ch1 linux basicsCh1 linux basics
Ch1 linux basics
 
Host security
Host securityHost security
Host security
 
Host security
Host securityHost security
Host security
 
kali linux.pptx
kali linux.pptxkali linux.pptx
kali linux.pptx
 
Linux basics
Linux basics Linux basics
Linux basics
 
Linux introductory-course-day-1
Linux introductory-course-day-1Linux introductory-course-day-1
Linux introductory-course-day-1
 
Linux lesson
Linux lesson Linux lesson
Linux lesson
 
LinuInterviewQALinuInterviewQALinuInterv
LinuInterviewQALinuInterviewQALinuIntervLinuInterviewQALinuInterviewQALinuInterv
LinuInterviewQALinuInterviewQALinuInterv
 

Recently uploaded

Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111GangaMaiya1
 
Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Celine George
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonQUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonhttgc7rh9c
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsNbelano25
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptNishitharanjan Rout
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsSandeep D Chaudhary
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptxJoelynRubio1
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...Amil baba
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Introduction to TechSoup’s Digital Marketing Services and Use Cases
Introduction to TechSoup’s Digital Marketing  Services and Use CasesIntroduction to TechSoup’s Digital Marketing  Services and Use Cases
Introduction to TechSoup’s Digital Marketing Services and Use CasesTechSoup
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningMarc Dusseiller Dusjagr
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...EADTU
 

Recently uploaded (20)

Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111
 
Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonQUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Our Environment Class 10 Science Notes pdf
Our Environment Class 10 Science Notes pdfOur Environment Class 10 Science Notes pdf
Our Environment Class 10 Science Notes pdf
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Introduction to TechSoup’s Digital Marketing Services and Use Cases
Introduction to TechSoup’s Digital Marketing  Services and Use CasesIntroduction to TechSoup’s Digital Marketing  Services and Use Cases
Introduction to TechSoup’s Digital Marketing Services and Use Cases
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learning
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 

introduction to linux operating system basic information

  • 1. B.Sc. Part II Semester IV (Paper II) LINUX OPERATING SYSTEM 1 Dr. Dileep Sadhankar, St. Francis De Sales College, Nagpur
  • 2. UNIT - I : 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. Commands: Basic Syntax for a command, Exploring the Home Directory, ls, mkdir, rmdir, stat, cat, rm, mv, cp 2 Dr. Dileep Sadhankar, St. Francis De Sales College, Nagpur
  • 3. Explain the process of logging in and logging out in Linux operating system.  When we boot the system, login prompt appears where we have to type a unique name that identifies as an authorized user on the system.  Depending on the distribution installed and how the X window system is set, the login prompt takes various shapes and forms.  if we installed Linux Mandrake and elected not to start the X window system when the system boots, the login prompt and associated late of information might look as shown below: 3 Dr. Dileep Sadhankar, St. Francis De Sales College, Nagpur
  • 4. INTRODUCTION  Linux is a Unix clone.  It can run on 32/64 bit hardware. It Can address upto 64 GB RAM.  Linux is true multitasking environment.  Linux was created by Linus Torvalds in 1991, and it has been developed with the help of many programmers across the Internet  The source code for Linux is freely available to everyone.  It has evolved into a very functional, powerful and usable clone of Unix which has at least 10 million users worldwide. 4 Dr. Dileep Sadhankar, St. Francis De Sales College, Nagpur
  • 5. 5 Dr. Dileep Sadhankar, St. Francis De Sales College, Nagpur
  • 6.  Portable: Linux operating system can work on different types of hardware as well as Linux kernel supports the installation of any kind of hardware platform.  Open Source: Source code of LINUX operating system is freely available.  Multiuser: Linux operating system is a multiuser system, which means, multiple users can access the system resources like RAM, Memory or Application programs at the same time.  Multiprogramming: Linux operating system is a multiprogramming system, which means multiple applications can run at the same time.  Hierarchical File System: Linux operating system affords a standard file structure in which system files or user files are arranged.  Shell: Linux operating system offers a special interpreter program, that can be used to execute commands of the OS. It can be used to do several types of operations like call application programs, and so on.  Security: Linux operating system offers user security systems using authentication features like encryption of data or password protection or controlled access to particular files. 6 Dr. Dileep Sadhankar, St. Francis De Sales College, Nagpur
  • 7. Why Linux? 1. A Linux Distribution has thousands of dollars worth of software for no cost. Full source code is provided and free. 2. Linux is a complete operating system: 1. stable - the crash of an application is much less likely to bring down the OS under Linux. 2. Reliable - Linux servers are often up for hundreds of days compared with the regular reboots required with a Windows system. 3. extremely powerful 3. Linux provides a complete development environment. 4. Excellent networking facilities 5. Ideal environment to run servers such as a web server, or an ftp server. 6. A wide variety of commercial software is available if not satisfied by the free software Easily upgradeable. 7. Supports multiple processors. 8. True multi-tasking, multi-user OS. 9. An excellent window system called X, the equivalent of Windows but much more flexible. 7 Dr. Dileep Sadhankar, St. Francis De Sales College, Nagpur
  • 8.  Logging in involves supplying a username and a password, which Linux verifies to determine whether the user has the authority to access the computer system.  When the login screen appears, first type the username assigned and then press enter.  You will be asked for the password. Notice that you do not see the password as you type.  After you have typed password press enter. Now you are ready to start exploring. The login session for regular user account is shown below: localhost login : sfsuser1 Password : [sfsuser1@localhost sfsuser1]$ 8 Dr. Dileep Sadhankar, St. Francis De Sales College, Nagpur
  • 9. Logging in as the superuser. The superuser has unrestricted access to the entire operating system (he has access to every file and every command). Only the superuser can change the system setup and configuration. There are two ways to work as the superuser. 1) Log in to the root account directly. That is type the username root and then give the password for the root account 2) Temporarily switch to the superuser account while working in user account. This involves executing Su command 9 Dr. Dileep Sadhankar, St. Francis De Sales College, Nagpur
  • 10. 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
  • 11. Shutting down the system Shutting down the system is a job for the system administrator because the shutdown command can be executed only by the superuser account following are the steps to turn off the computer. 1) Log out of user account. Type logout and press Enter. 2) Return to the console where the root user is logged in press Alt + F1. 3) Terminate the session: Type shutdown -h now and press Enter. The system will go through the shutdown process and will turn off services and unmount devices. 11 Dr. Dileep Sadhankar, St. Francis De Sales College, Nagpur
  • 12. The center of the Linux operating system is the kernel. The kernel is a piece of software that provides an interface between user, the computer hardware, and attached peripherals. The kernel is responsible for maintaining the file system, executing commands, starting programs, timing system activities and managing system memory and other resources. The following Figure shows how the different parts of the kernel work together Figure. The kernel uses several tools to help it run the operating system. Anatomy Of The Linux Operating System 12 Dr. Dileep Sadhankar, St. Francis De Sales College, Nagpur
  • 13.  The kernel gives instructions to the system using system calls.  System calls are communications between the kernel and the devices it manages, which direct the performance of actions requested by commands it receives from internal system processes or running applications, or are passed from the shell.  These are the vehicles used by the kernel to execute shell commands. The system calls coordinate the activities of the kernel to produce the output for a command that has been executed by the system user.  Most important job the kernel manage the computer's memory resources. The memory resources are required to start processes that activate devices and services and cause the computer system to perform its job. All these happenings are managed through the file system. 13 Dr. Dileep Sadhankar, St. Francis De Sales College, Nagpur
  • 14. Linux Directory Structure (File System Structure) 14 Dr. Dileep Sadhankar, St. Francis De Sales College, Nagpur
  • 15. 1. / (Root Directory): Everything on your Linux system is located under the / directory, known as the root directory.. Only root user has write privilege under this directory. Please note that /root is root user’s home directory, which is not same as /. 2. /bin (User Binaries or programs): Contains binary executables. Common Linux commands you need to use in single-user modes are located under this directory. Commands used by all the users of the system are located here. For example: ps, ls, ping, grep, cp. 3. /sbin (System Binaries): Just like /bin, /sbin also contains binary executables. But, the linux commands located under this directory are used typically by system aministrator, for system maintenance purpose. For example: iptables, reboot, fdisk, ifconfig, swapon 4. /etc (Configuration Files): Contains configuration files required by all programs. This also contains startup and shutdown shell scripts used to start/stop individual programs. For example: /etc/resolv.conf, /etc/logrotate.conf 15 Dr. Dileep Sadhankar, St. Francis De Sales College, Nagpur
  • 16. 5. /dev (Device Files): Linux exposes devices as files, and the /dev directory contains a number of special files that represent devices. These include terminal devices, usb, or any device attached to the system. For example: /dev/tty1, /dev/usbmon0 6. /proc (Process Information): Contains information about system process. This is a pseudo filesystem contains information about running process. For example: /proc/{pid} directory contains information about the process with that particular pid. This is a virtual filesystem with text information about system resources. For example: /proc/uptime 7. /var (Variable Files): var stands for variable files. Content of the files that are expected to grow can be found under this directory. This includes — system log files (/var/log); packages and database files (/var/lib); emails (/var/mail); print queues (/var/spool); lock files (/var/lock); temp files needed across reboots (/var/tmp); 8. /tmp (Temporary Files): Directory that contains temporary files created by system and users. Files under this directory are deleted when system is rebooted. 16 Dr. Dileep Sadhankar, St. Francis De Sales College, Nagpur
  • 17. 9. /usr (User Programs): Contains binaries, libraries, documentation, and source-code for second level programs. /usr/bin contains binary files for user programs. If can’t find a user binary under /bin, look under /usr/bin. For example: at, awk, cc, less, scp. /usr/sbin contains binary files for system administrators. If can’t find a system binary under /sbin, look under /usr/sbin. For example: atd, cron, sshd, useradd, userdel. /usr/lib contains libraries for /usr/bin and /usr/sbin. /usr/local contains users programs that you install from source. For example, when you install apache from source, it goes under /usr/local/apache2 10. /home (Home Directories): Home directories for all users to store their personal files. For example: /home/john, /home/nikita 11. /boot (Boot Loader Files): The /boot directory contains the files needed to boot the system. Kernel initrd, vmlinux, grub files are located under /boot. For example: initrd.img-2.6.32-24-generic, vmlinuz-2.6.32-24-generic 17 Dr. Dileep Sadhankar, St. Francis De Sales College, Nagpur
  • 18. 12. /lib (System Libraries): Contains library files that supports the binaries located under /bin and /sbin. Library filenames are either ld* or lib*.so.* For example: ld-2.11.1.so, libncurses.so.5.7 13. /opt (Optional add-on Applications): opt stands for optional. Contains add-on applications from individual vendors. add-on applications should be installed under either /opt/ or /opt/ sub-directory. 14. /mnt (Mount Directory): Temporary mount directory where sysadmins can mount filesystems. 15. /media (Removable Media Devices): The /media directory contains subdirectories where removable media devices inserted into the computer are mounted. For examples, /media/cdrom for CD-ROM; /media/floppy for floppy drives; /media/cdrecorder for CD writer 16. /srv (Service Data): srv stands for service. Contains server specific services related data. For example, /srv/cvs contains CVS related data. 18 Dr. Dileep Sadhankar, St. Francis De Sales College, Nagpur
  • 19. Types of Files in Linux 19 Dr. Dileep Sadhankar, St. Francis De Sales College, Nagpur
  • 20. Linux contains many files, each filled with different information. Mainly there are three types of files:  User data files  System data files  Executable files 20 Dr. Dileep Sadhankar, St. Francis De Sales College, Nagpur
  • 21.  User data files: These files are created by the user and usually contain simple data made up of text and numbers. Files such as .txt files can be read with a text editor. But the more complex files, such as the files which user create with graphics or spreadsheet programs requires a viewer or interpreter program to display them.  System data files: These files are used by the operating system to keep track of user passwords, logins, file permissions, and other things pertaining to keeping the system running smoothly.  Executable files: These files contain the instructions that tell the computer what to do. These files are usually called programs. When the user give the command to the computer, this means user telling it to follow the instructions in an executable file. 21 Dr. Dileep Sadhankar, St. Francis De Sales College, Nagpur
  • 22. Rules for naming files and directories in Linux operating system • Any system configuration files that user may edit and any application programs that user may install are assigned names and a place where they live in the system. • User work with these applications and can add new files to the file system for the letters, reports, spreadsheets, web pages and pictures that he create. • To save a document for the first time user needs to select a directory in the file system in which to store the file and give the file a name. Following are the different rules to store files and directories in the right place and naming them. 1) A filename should not exceed 256 characters. It is not just the name of the individual file, it includes the directory path that leads to the file. For ex: The individual file named picture.jpg that is located in the /home/sfs/images directory. The actual filename is, /home/sfs/images/picture.jpg is 28 characters long. 22 Dr. Dileep Sadhankar, St. Francis De Sales College, Nagpur
  • 23. 2) Uppercase letters (A to Z), lowercase letters (a to z) or any number (0-9) can be used when creating a filename. Dash (-), underscore ( _ ) and dot (.) can also be used in filename. 3) Do not put a space in the filename. Avoid the following use characters that can cause problems in file names. < , > , ' , “ , # , * , | , : , ( , ) , ^ , ! , , & , ? , ^ , ~ 4) To create hidden files, begin the filename with a period (.).For ex : .diary.txt 5) Type cat > practice and press Enter to create a file named practice. The cursor will move to the next line on the screen. Type few words and press Enter to move to the next line press ctrl + D to save and close the file. 6) Type cat practice and press Enter to read the file you just created. 23 Dr. Dileep Sadhankar, St. Francis De Sales College, Nagpur
  • 24. SPAWNING PROCESSES  Spawn in computing refers to a function that loads and executes a new child process. The current process may wait for the child to terminate or may continue to execute concurrent computing. Creating a new sub-process requires enough memory in which both the child process and the current program can execute.  Linux defines running programs, applications, utilities and daemons (servers) as processes. It maintains a virtual file system in the /proc directory, where the pointers to all the ongoing processes in the system are maintained.  Linux is a true multitasking operating system ( can perform more than one thing at a time). To accomplish this, the Linux kernel just calls up a few daemons, and the daemons take over and perform the job. 24 Dr. Dileep Sadhankar, St. Francis De Sales College, Nagpur
  • 25. SPAWNING PROCESSES  While a process is running, it can spawn other processes. Spawning is accomplished through the use of a system call, fork. System calls are clearly defined, direct entry points into the kernel through which processes request services from the kernel.  The first step in spawning a new process is for an existing process to create an identical way of itself. This copy is then transferred into the new process, and it in turn, can create additional processes, thereby resulting on multiple generations of processes. (i.e. parent processes spawn children processes which then spawns grandchildren processes). 25 Dr. Dileep Sadhankar, St. Francis De Sales College, Nagpur
  • 26. What is shell program?  A shell program is the user interface to the computer system for the Linux operating system. This interface accepts commands from the user and translates it into a language that the operating system can understand.  The shell can also be used to write programs, automate job control, and provide a scripting mechanism to customize the way the system works.  Shell program is one of the most important programs installed on the Linux system. The following figure illustrates how the process operates using shell. 26 Dr. Dileep Sadhankar, St. Francis De Sales College, Nagpur
  • 27. 27 Dr. Dileep Sadhankar, St. Francis De Sales College, Nagpur
  • 28. What is bash shell? Explain.  The shell is a program that takes commands from the keyboard and gives them to the operating system to perform.  Bash (Bourne Again Shell ) is the free version of the Bourne shell distributed with Linux and GNU operating systems. The bash shell is the most widely used shell in Linux.  Created to improve on the earlier sh shell, Bash includes features from the Korn shell and the C shell.  It offers functional improvements over sh for both interactive and programming use.  The bash shell works like the Bourne shell (sh). There is a symbolic link, in the /bin directory of sh that points to the bash shell. 28 Dr. Dileep Sadhankar, St. Francis De Sales College, Nagpur
  • 29. Explain the process of running the bash shell. Following are the steps to start or run the bash shell. 1) Display the shell you are using. This information is found in the SHELL environment variable. Type echo $SHELL and press Enter If you are using bash shell the system will display the following. [sfsuser1@localhost/sfsuser1]$echo $SHELL /bin/bash [sfsuser1@localhost/sfsuser1]$ 29 Dr. Dileep Sadhankar, St. Francis De Sales College, Nagpur
  • 30. 2) If you are not using bash, change to the bash shell. Type bash and press Enter. 3) If you want bash to be the default shell, type chsh -5/bin/bash and press Enter. 4) Display the bash help function. Type help and press enter. The help command lists all the commands that are built into the shell. [sfsuser1@localhost/sfsuser1]$help and press enter 30 Dr. Dileep Sadhankar, St. Francis De Sales College, Nagpur
  • 31. What is shell prompt? Explain.  The shell prompt (or command line) is where one types commands. When accessing the system through a text-based terminal, the shell is the main way of accessing programs and doing work on the system. The shell keeps track of the work that is performed on the computer.  The prompt, $, which is called the command prompt, is issued by the shell. While the prompt is displayed, you can type a command.  Shell reads your input after you press Enter.  The default shell prompt is often different for different distributions. When logged in as root (superuser) the shell prompt looks like : [root@ localhost root] # 31 Dr. Dileep Sadhankar, St. Francis De Sales College, Nagpur
  • 32. $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
  • 33. Explain the steps of changing the shell prompt. The shell prompt can be changed to display information such as the username for a user, the directory in which the user is working, the current date and time, or a special message. To change the shell prompt for current login session follow the steps below: 1) Display the shell variables: At the shell prompt, type printenv and press Enter 2) Look for the ps1 variable: The ps1 variable on a Linux-Mandrake system might look as follows: ps1 = [u@hw]$ 33 Dr. Dileep Sadhankar, St. Francis De Sales College, Nagpur
  • 34. This variable tells the system to display the username for whenever using the host computer and that user's current working directory inside brackets followed by the $ prompt (or # prompt for root account). 3) Write down the information from the ps1 variable. 4) Change the prompt so that it displays the time, the date, the current working directory, and the $ prompt. Type ps1 = “[t d w] $” and press Enter. The shell prompt will change to display the following: [09: 55:33 Thu Feb 11 sfsuser1] $ 34 Dr. Dileep Sadhankar, St. Francis De Sales College, Nagpur
  • 35. Character Description ! 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
  • 36. What is command? Explain the basic syntax for a command Linux operating system.  The commands can be used to manage the Linux system and these commands can be modified to behave the way, the user want, also can be modified to perform tasks in addition to the default actions of the command .  These modifications can take the form of a command option, a parameter, an input/output redirection, or a pipe.  After discovering, how all these elements work together on the command line, the user can use any Linux command 36 Dr. Dileep Sadhankar, St. Francis De Sales College, Nagpur
  • 37. The Basic syntax for a command. Following is the basic syntax for a command. Commandname -options [Parameter]  Command is typed after the shell prompt. To execute the command press Enter. For ex: ls -1 /usr/doc  The command used in this example is ls, which displays a file list for the contents of the current working directory. The command option is -1, which modifies the information displayed about each file in the listing. The parameter tells the command to list the contents of the /usr/doc directory instead of current working directory. 37 Dr. Dileep Sadhankar, St. Francis De Sales College, Nagpur
  • 38. Explain the steps of creating temporary user account in Linux operating system. When the Linux is installed, a super user (or root user) account and possibly one unprivileged user account is created. But if during the installation of Linux operating system an account for unprivileged user account is not created then use the following steps to create it. 1) Select the username: Username should not be more than eight characters. To make the job of the system administrator simpler, use lowercase letters for username. For ex. : sfsuser1 38 Dr. Dileep Sadhankar, St. Francis De Sales College, Nagpur
  • 39. 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 root and 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
  • 40. 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
  • 41. 6) Switch to new terminal: Instead of logging out of the superuser account to get to user account, press ALT + F2 to display new terminal window. To return to superuser account press ALT +F1. 7) Log in to user account: At the login prompt type username and press Enter. Type the password and press Enter. The shell prompt appears as shown below: [sfsuser1@localhost/sfsuser1]$ 41 Dr. Dileep Sadhankar, St. Francis De Sales College, Nagpur
  • 42. Anatomy of Linux OS 42 Dr. Dileep Sadhankar, St. Francis De Sales College, Nagpur
  • 43. Figure: Anatomy of Linux operating System 43 Dr. Dileep Sadhankar, St. Francis De Sales College, Nagpur
  • 44. Linux based system comprises of several parts. These are: • The Kernel • System Libraries • Command Shell and command line utilities • Graphical User Interfaces 44 Dr. Dileep Sadhankar, St. Francis De Sales College, Nagpur
  • 45. The Kernel:  The kernel is the heart of the operating system.  Linux kernel is what is called as a “monolithic kernel”, which means that all the core kernel functions and any hardware driver modules are build into a single executable which is then executed in what is known as “kernel space”, which means it has full privileged access to the underlying hardware.  The Linux kernel provides an abstraction of the hardware, along with a set of operations known as “system calls”. System Libraries: • The “libraries” are a collection of computer code that provide a way of doing common tasks, such as reading or writing a from a file, or opening a network connection, and these are used to make programming simpler and to ensure that all programs which use a particular library interface with the kernel and other programs the same way. 45 Dr. Dileep Sadhankar, St. Francis De Sales College, Nagpur
  • 46. Command Shell and command line utilities  The shell is an interface between the user and the kernel. It takes commands from the user and executes kernel’s functions. This includes things like things like mount and un- mount file systems, list and access contents of a file systems, start and stop processes, load and unload kernel driver modules, and many other tasks.  The Shell are classified into two types: command line shells and graphical shells. The command line shells provide a command line interface, while the graphical line shells provide a graphical user interface. Though both shells perform operations, but the graphical user interface shells perform slower than the command line interface shells. Types of shells are classified into four:  Korn shell  Bourne shell  C shell 46 Dr. Dileep Sadhankar, St. Francis De Sales College, Nagpur
  • 47. Graphical User Interfaces:  The various graphical user interfaces that are possible on a system Linux come with a suite of applications and utilities to make the system look much prettier, more functional, or simply easier to use.  The “X windows system” is the most commonly used graphical user interface system provided by various Linux distributions, and it is most commonly installed on Linux based desktops and laptops. 47 Dr. Dileep Sadhankar, St. Francis De Sales College, Nagpur