0% found this document useful (0 votes)
19 views

Linux-Lecture1 113607

Uploaded by

sammaalbert
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

Linux-Lecture1 113607

Uploaded by

sammaalbert
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 72

CSU07316/ITU07316: Advanced

Operating Systems

Introduction to LINUX
Today’s Topics:
– Introduction to Unix/Linux
– VirtualBox
– Ubuntu install (your Homework 1)
Introduction to Linux

UNIX/LINUX OPERATING SYSTEM


Introduction to Unix
History of UNIX
What is LINUX
LINUX Distributions
Unix OS Structure
Unix File System
Unix Directories, Files and Inodes
Users, Groups and Permissions
Introduction to Linux

UNIX/LINUX OPERATING SYSTEM


Introduction to Unix
History of UNIX
What is LINUX
LINUX Distributions
Unix OS Structure
Unix File System
Unix Directories, Files and Inodes
Users, Groups and Permissions
Introduction to Linux

UNIX

Unix is a multi-user, multi-tasking operating


system.
You can have many users logged into a system
simultaneously, each running many programs.
It's the kernel's job to keep each process and user
separate and to regulate access to system
hardware, including cpu, memory, disk and other
I/O devices.
Introduction to Linux

History of UNIX

First Version was created in Bell Labs in 1969.


Some of the Bell Labs programmers who had
worked on this project, Ken Thompson, Dennis
Ritchie, Rudd Canaday, and Doug McIlroy
designed and implemented the first version of the
Unix File System on a PDP-7 along with a few
utilities. It was given the name UNIX by Brian
Kernighan.
00:00:00 Hours, Jan 1, 1970 is time zero for UNIX. It
is also called as epoch.
Introduction to Linux

History of UNIX
1973 Unix is re-written mostly in C, a new language
developed by Dennis Ritchie.
Being written in this high-level language greatly
decreased the effort needed to port it to new
machines.
Introduction to Linux

History of UNIX

1977 There were about 500 Unix sites world-wide.


1980 BSD 4.1 (Berkeley Software Development)
1983 SunOS, BSD 4.2, System V
1988 AT&T and Sun Microsystems jointly develop
System V Release 4 (SVR4). This later developed
into UnixWare and Solaris 2.
1991 Linux was originated.
Introduction to Linux

What is LINUX

Linux is a free Unix-type operating system


originally created by Linus Torvalds with the
assistance of developers around the world.
It originated in 1991 as a personal project of Linus
Torvalds, a Finnish graduate student.
The Kernel version 1.0 was released in 1994 and
today the most recent stable version is 5.10.1
Developed under the GNU General Public License ,
the source code for Linux is freely available to
everyone.
Introduction to Linux

LINUX Distributions
Mandrake: http://www.mandrakesoft.com/
RedHat: http://www.redhat.com/
Fedora: http://fedora.redhat.com/
SuSE/Novell: http://www.suse.com/
Debian: http://www.debian.org/
Ubuntu: http://www.ubuntu.org/
How is Linux Used?
 Personal Workstation
 File and Print Server
 Internet Service Provider
 Three-tier Client/Server
 Able to host huge databases in big
corporations
Linux Hardware
Requirements
• CPU
• Main memory
• Optical Drive
• Graphic card
• Hard Drive
• Sound Card
CPU
• IBM
• INTEL
• Pentium I – III
• No 286, 386, 486, and Celeron
• AMD
• K6/II/III
• Duran
• Athlon, Athlon XP/MP
Main Memory
• Capacity:
– Minimum requirement 64MB
– Recommended 128MB and up
Optical Drive
• CD-ROM / DVD-ROM
– Sony, Philips, and Acer
– SuSE website has compatibility listing
• CD-R
– Sony, Philips, and Acer
Graphics Cards

• Supports new cards on the market


– ATI: Radeon 7500/8500, FireGl 8700/8800,
FireGL 2/4
– Matrox: G450/G550
– nVidia: GeForce 2/3/4, nForce
Hard Drives
• Capacity
– Min: 400MB
– Full Install: 3GB
– Anything above 3GB
Sound Card
• All common sound cards
– Dell & Yamaha OPL3-SA
• Professional audio:
– Soundblaster: Audigy
– Terratec: EWX 24/96 (Sereo I/O analog and
digital), EWS 88 MT (8 analog channels),
EWS 88D (10 digital channels in ADAT
format)
Configuring Linux System
1. Selecting a language
2. Choosing automatic or manual
partitioning
3. Type of software to install
4. Choosing which drive to boot from
Configuring Linux (continued)
5. Adjusting the time settings
6. Configuring the hardware aspect of the
system
7. Creating the root password (for the
Administrator), and user accounts
8. Hardware configuration
Working with Linux

Graphical User Interface

• X Window System
Why Use Linux?
• Costs less
• Stable
• Reliable
• Extremely powerful
LINUX VS WINDOWS
Linux vs. Windows
• Financial Differences
• Technical Differences
• End-User Differences
Linux vs. Windows
Financial Differences
Linux vs. Windows

COST
LINUX WINDOWS
Online Downloads Free Not Available
Retail Price, CD $50 $300
Linux vs. Windows
• Cost for Businesses
– Companies have to spend millions for
licenses for every individual windows
computer
– For Linux companies don’t have to spend
anything
Linux vs. Windows
Technical Differences
Linux vs. Windows
 Keeping up to date
By Upgrading
Linux upgrades faster than Windows
 Compatibility
Linux is Backward Compatible unlike
Windows
Linux vs. Windows

Features Provided
 Both support Dynamic Caching
 Both have Multi-user Support
Linux vs. Windows
• Application Differences
 No commercial word processor for Linux,
which matches the quality for Windows
Linux vs. Windows
End-User Differences
Linux vs. Windows
• Proprietary vs. Open Source
Windows is a Proprietary Technology
Applications will only work on Windows
Linux – Open Source
Linux
 Complete information needed for
download
 Technical help – Available on Internet
(user must be comfortable with UNIX
system)
 Windows word processor is better than
Linux
Linux vs. Windows
In The Commercial Arena
 Head to head competition
 Used side by side as servers
 Both handled daily workload for several
small business operations
 System Administration – Most significant
difference
 Linux – tougher environment
 Linux requires learning multi-user issues
built into Unix-file permissions
Conclusion
“When is it best to use Linux and when
should some other operating system be
preferred?”
 It all depends on the user
Introduction to Linux

UNIX Structure
Introduction to Linux

UNIX Structure
Shell
• shell: An interactive program that uses user input to
manage the execution of other programs.
– A command processor, typically runs in a text
window.
– User types commands, the shell runs the
commands
– Several different shell programs exist:
• bash : the default shell program on most
Linux/Unix systems
• We will use bash
• Other shells: Bourne, csh, tsch
Why use a shell?
• Why should I learn to use a shell when GUIs
exist?
– faster
– work remotely
– programmable
– customizable
– repeatable
Example shell commands
command description
pwd print the current working directory
cd changes the working directory
ls lists files in a directory
man brings up the manual for a command
exit logs out of the shell

$ pwd
/homes/raphael
$ cd CSU07308
$ ls
file1.txt file2.txt
$ ls –l
-rw-r--r-- 1 rea fac_cs 0 2020-11-29 17:45 file1.txt
-rw-r--r-- 1 rea fac_cs 0 2020-11-29 17:45 file2.txt
$ cd ..
$ man ls
$ exit
System commands
command description
man or info get help on a command
clear clears out the output from the console
exit exits and logs out of the shell
date output the system date
cal output a text calendar
uname print information about the current system

• "man“ pages are a very important way to learn


new commands
man ls
man man
Relative directories
directory description
. the directory you are in ("working directory")
.. the parent of the working directory
(../.. is grandparent, etc.)
~ your home directory
(on many systems, this is /home/username
)
~username username's home directory
~/Desktop your desktop
Directory commands
command description
ls list files in a directory
pwd print the current working directory
cd changes the working directory
mkdir create a new directory
rmdir delete a directory (must be empty)

• some commands (cd, exit) are part of the


shell ("builtins")
• others (ls, mkdir) are separate programs the
shell runs
Command-line arguments
• many accept arguments or parameters
– example: cp (copy) accepts a source and
destination file path
• a program uses 3 streams of information:
– stdin, stdout, stderr (standard in, out, error)
• input: comes from user's keyboard
• output: goes to console
• errors can also be printed (by default, sent to
console like output)
Command-line arguments
• parameters vs. input
– parameters: before Enter is pressed; sent in by
shell
– input: after Enter is pressed; sent in by
user
Command-line arguments
• most options are a - followed by a letter such as -c
– some are longer words preceded by two - signs, such as –
count
• options can be combined: ls -l -a -r can be ls –
lar
• many programs accept a --help or -help option to
give more information about that command (in addition
to man pages)
– or if you run the program with no arguments, it may print help
info

• for many commands that accept a file name argument, if


you omit the parameter, it will read from standard input
Introduction to Linux

UNIX File System


Unix file system
directory description
/ root directory that contains all others
(drives do not have letters in Unix)
/bin programs
/dev hardware devices
/etc system configuration files
 /etc/passwd stores user info
 /etc/shadow stores passwords
/home users' home directories
/media, drives and removable disks that have been
/mnt, ... "mounted" for use on this computer
/proc currently running processes (programs)
/tmp, /var temporary files
/usr user-installed programs
Introduction to Linux

File System

The Unix file system looks like an inverted tree


structure.
You start with the root directory, denoted by /, at
the top and work down through sub-directories
underneath it.
Introduction to Linux

File System
Each node is either a file or a directory of files,
where the latter can contain other files and
directories.
You specify a file or directory by its path name,
either the full, or absolute, path name or the one
relative to a location.
The full path name starts with the root, /, and
follows the branches of the file system, each
separated by /, until you reach the desired file,
e.g.:
/home/condron/source/xntp
Introduction to Linux

File System
A relative path name specifies the path relative to
another, usually the current working directory that
you are at. Two special directories :
. the current directory
.. the parent of the current directory
So if I'm at /home/frank and wish to specify the path
above in a relative fashion I could use:
../condron/source/xntp
This indicates that I should first go up one directory
level, then come down through the condron
directory, followed by the source directory and then
to xntp.
Introduction to Linux

Structure of Standard Directories


in Unix/Linux
/ The ancestor of all directories on the system; all
other directories are subdirectories of this
directory, either directly or through other
subdirectories.
/bin Essential tools and other programs (or
binaries).
/dev Files representing the system's various
hardware devices. For example, you use the file
`/dev/cdrom' to access the CD−ROM drive.
/etc Miscellaneous system configuration files,
startup files, etc.
Introduction to Linux

Structure of Standard Directories


in Unix/Linux
/home The home directories for all of the system's
users.
/lib Essential system library files used by tools in
`/bin'.
/proc Files that give information about current
system processes.
/root The superuser's home directory, whose
username is root. (In the past, the home directory
for the superuser was simply `/'; later, `/root' was
adopted for this purpose to reduce clutter in `/'.)
Introduction to Linux
Structure of Standard Directories
in Unix/Linux
/sbin Essential system administrator tools, or
system binaries.
/tmp Temporary files.
/usr Subdirectories with files related to user tools
and applications.
File commands
command description
cp copy a file
mv move or rename a file
rm delete a file
touch create a new empty file, or
update its last-modified time stamp

• caution: the above commands do not prompt


for confirmation
Introduction to Linux

Directories, Files and Inodes


Every directory and file is listed in its parent
directory.
In the case of the root directory, that parent is itself.
A directory is a file that contains a table listing the
files contained within it, giving file names to the
inode numbers in the list.
The information about all the files and directories is
maintained in INODE TABLE
An Inode (Index Nodes) is an entry in the table
containing information about a file (metadata)
including file permissions, UID, GID, size, time
stamp, pointers to files data blocks on the disk etc.
Introduction to Linux
Users, Groups and Access
Permissions
In UNIX/LINUX, there is a concept of user and an
associated group

The system determines whether or not a user or


group can access a file or program based on the
permissions assigned to them.

Apart from all the users, there is a special user


called Super User or the root which has permission
to access any file and directory
Introduction to Linux

Access Permissions
There are three permissions for any file, directory
or application program.

The following lists the symbols used to denote


each, along with a brief description:

r — Indicates that a given category of user can


read a file.

w — Indicates that a given category of user can


write to a file.

x — Indicates that a given category of user can


execute the file.
Introduction to Linux

Access Permissions
Each of the three permissions are assigned to
three defined categories of users.
The categories are:

owner — The owner of the file or


application.
group — The group that owns the file or
application.
others — All users with access to the
system.
Introduction to Linux

Access Permissions
One can easily view the permissions for a file by
invoking a long format listing using the command
ls -l.

For instance, if the user juan creates an executable


file named test, the output of the command ls -l
test would look like this:

-rwxrwxr-x 1 juan student 0 Sep 26 12:25 test


Introduction to Linux

Access Permissions
The permissions for this file are listed are listed at
the start of the line, starting with rwx.

This first set of symbols define owner access.

The next set of rwx symbols define group access

The last set of symbols defining access permitted


for all other users.
Introduction to Linux

Access Permissions
This listing indicates that the file is readable,
writable, and executable by the user who owns the
file (user juan) as well as the group owning the file
(which is a group named student).

The file is also world-readable and world-


executable, but not world-writable.
Introduction to Linux

Listing the Content of a Directory

ls is used to list the contents of a directory.

If the command ls is written with parameter –l then


the command lists contents of the working
directory with details. Example:

$ ls –l
Introduction to Linux

Moving in Directories
 cd try_it - Changes the directory to try_it
 pwd: Prints the contents of the current working
directory
 Example: if current working directory is
/home/smith/try_it
 cd .. Move to superior directory
 pwd : Prints /home/smith
 cd /home The absolute path
 pwd : Prints /home
 cd The system is returned to the user home
directory
 pwd : Print /home/smith
Introduction to Linux

Make Directory

The command mkdir my_dir

makes new directory my_dir (the path is given


relative) as a subdirectory of the current directory.
Introduction to Linux

Remove Directory

The command rmdir your_dir


removes directory your_dir if it is empty.
Introduction to Linux

Copy File

The command cp file_1 file_2

copies file_1 to file_2.

Both files must be in the same working directory.

If they are in various directories, the path must be


given.
Introduction to Linux

Rename and/or Move the File

The command mv file_1 file_2

moves file_1 to file_2

Both files must be in the same working directory.

If they are in different directories, the path must be


given.

file_1 is removed from the disk.


Introduction to Linux

Remove File
The command rm file_a , removes the file_a from
the system
If you use wildcard. For example
rm h*c , you will remove all files beginning with h
and ending with c which are in working directory.
If you write rm * , you will erase all files from
your working directory.
Introduction to Linux

Access Permission of File/Directory


The ownership of the file or directory can be changed using
the command
chown <owner> <file/directory name>
The group of the file or directory can be changed using the
command
chgrp <group> <file/directory name>
The permissions of the file can be changed using chmod
command
chmod -R ### <filename or directory>
-R is optional and when used with directories will traverse all
the sub-directories of the target directory changing ALL the
permissions to ###.
Introduction to Linux
Access Permission of
File/Directory
The #'s can be:
0 = Nothing
1 = Execute
2 = Write
3 = Execute & Write (2 + 1)
4 = Read
5 = Execute & Read (4 + 1)
6 = Read & Write (4 + 2)
7 = Execute & Read & Write (4 + 2 + 1)

You might also like