Professional Documents
Culture Documents
Lecture-16: Working With Command Line Interface in LINUX
Lecture-16: Working With Command Line Interface in LINUX
User 3 Shared
User1
Computer
User 4
User 2
User 3 Shared
User1
Computer
User 4
User 2
User 3 Shared
User1
Computer
User 4
User 2
User 3 Shared
User1
Computer
User 4
ADVANTAGES
User Interact to the system
Context Switching is introduced
MULTIPROCESSING
There are multiple processors
These processors share same main memory and I/O facilities
All processors can perform the same functions
MULTIPROCESSING
Running program, job and process almost interchangeably.
Independent process cannot affect or be affected by the execution of
another process.
Cooperating process can affect or be affected by the execution of
another process
Perhaps exchanging info or control via some mechanisms (comm &
sync)
– Advantages of process cooperation (concurrency)
• Information sharing
• Computation speed-up
• Modularity
• Convenience
MODERN OPERATING SYSTEMS
Multithreading
Process is divided into threads that can run concurrently
15
Thread
Dispatchable unit of work
executes sequentially and is interruptable
20
understand, change and port to other machines.
Simpler user interface or user services
Provides simple routines to write complex programs/develop
utilities
Hierarchical file system for easy maintenance
Consistent format for files (byte streams) making application
development easier
Simple, consistent interface to peripheral devices
THE BIRTH OF LINUX
• Kernel
Application Programs
• Shell
UNIX commands and
22
libraries
• Utilities
System call
interface
bash
H/W
who
Kernel
wc
vi
Some Basic Characteristics of Linux
• Multi-user System
23
• Multiprogramming/Multitasking system
Characteristics:
• Hierarchical structure
24
• Consistent treatment of file data
• Ability to create, modify and delete files
• Dynamic growth of files
• Protection of file data
• Treating peripheral devices (terminals, tapes, etc.) as
files
Linux File System Layout (RedHat)
25
Directory Structure of Linux File System
Directory Content
Common programs, shared by the system, the system administrator and
/bin
the users.
26
The startup files and the kernel, vmlinuz. In recent distributions also grub
/boot data. Grub is the GRand Unified Boot loader and is an attempt to get rid
of the many different boot-loaders we know today.
Contains references to all the CPU peripheral hardware, which are
/dev
represented as files with special properties.
Most important system configuration files are in /etc, this directory
/etc
contains data similar to those in the Control Panel in Windows
/home Home directories of the common users.
/initrd (on some distributions) Information for booting. Do not remove!
Library files, includes files for all kinds of programs needed by the
/lib
system and the users.
Directory Structure of Linux File System
Directory Content
Every partition has a lost+found in its upper directory. Files that were saved during
/lost+found
failures are here.
/misc For miscellaneous purposes.
27
/mnt Standard mount point for external file systems, e.g. a CD-ROM or a digital camera.
/net Standard mount point for entire remote file systems
/opt Typically contains extra and third party software.
A virtual file system containing information about system resources. More information
/proc about the meaning of the files in proc is obtained by entering the command man proc in
a terminal window.
The administrative user's home directory. Mind the difference between /, the root
/root
directory and /root, the home directory of the root user.
/sbin Programs for use by the system and the system administrator.
/tmp Temporary space for use by the system.
/usr Programs, libraries, documentation etc. for all user-related programs.
Storage for all variable files and temporary files created by users, such as log files, the
/var mail queue, the print spooler area, space for temporary storage of files downloaded
from the Internet, or to keep an image of a CD before burning it.
Types of files in a Linux System
28
Regular files : they contain normal data, for example text files, executable files
or programs, input for or output from a program and so on.
Directories: files that are lists of other files.
Special files: Devices treated as files, used for input and output. They exist
in /dev.
Links: a system to make a file or directory visible in multiple parts of the
system's file tree.
(Domain) sockets: a special file type, similar to TCP/IP sockets, providing inter-
process networking protected by the file system's access control.
Named pipes: act more or less like sockets and form a way for processes to
communicate with each other, without using network socket semantics.
Permissions of a file
•Read
29
•Write
•execute
Listing files in a Linux System
The -l option to ls displays the file type, using the first character of each input line:
psdg/Documents> ls –l
30
total 8
-rw-rw-r-- 1 psdg faculty 31744 Feb 21 17:56 samplefile1.doc
lrw-rw-r-- 1 psdg faculty 41472 Feb 21 17:56 samplefile2
drwxrwxr-x 2 psdg faculty 4096 Feb 25 11:50 os-course/
crw-rw-r-- 1 psdg faculty 41472 Feb 21 17:56 /dev/tty00
Symbol Meaning
- Regular file
d Directory
l Link
c Special file
s Socket
p Named pipe
User Accounts
• login nmes
31
• passwords
• user id
• group id
• Home directory
EVVIRONMENTS
Gnome: GNU Network Object Model Environment
KDE: K Desktop Environment.