SlideShare a Scribd company logo
1 of 50
The Unix
Operating System
SE 101
Spiros Mancoridis
Wha t i s a n OS?
An operating system (OS)is software that
manages the resources of a computer
Like most managers, the OSaims to manage
its resources in a safe and efficient way
Examples of computer resources are: CPU,
RAM, disk memory, printers, displays,
keyboard, mouse, etc
The OSalso isolates users and application
programmers from the underlying computer
Operating Systems
Microsoft Windows Unix
OS Ar chitectur e
Without an OS, every application would have to
implement some part of this software hierarchy ...
Unix
A popular multi-user, multi-tasking OS
Attributes: stability, portability, security
Created at Bell Labs by Dennis Ritchie and Ken
Thompson (won theACM Turing Award in 1983)
Unix is considered one of the greatest
achievements in computer science
Has been around since the 1960s in various forms,
e.g.,AIX, SCO Unix, SunOS, FreeBSD, OpenBSD,
NetBSD, Linux, Mac OSX
Unix
Multiuser and Multitasking
T
oolbox philosophy
Concise syntax
Designed by programmers for programmers
1983ACM Tur ning
Awar d (Unix)
ACM is theAssociation for Computing
Machinery
World’s largest educational and scientific
computer society
You can become a student member too
www.acm.org
The ACM awards the Turing Award
every year. It is the “Nobel Prize” of
computing
Named after british
mathematician Alan M. Turing
(1912-1954)
Thompson and Ritchie
Alan M. Turing
Unix Ker nel
Includes device drivers for computer hardware
devices, e.g., graphics cards, network cards, disks
A device driver is a program that allows computer
programs to interact with hardware devices
CPU and memory management
File system management
Implements system calls that can be used by
application programs and system utilities
What’s inside the Box?
The von Neumann Architecture
The OShides this complexity from the programmer
Unix Shells and GUIS
Shellsare used for command
line input/ o utput to and from
users
e.g., sh (Bourne shell), bash
(Bourne again shell), csh (C
shell), ksh(Korn shell)
GUIs are used for graphical I/ O
e.g., Linux KDE, GNOME, Mac
OSLeopard
Unix System Utilities
System utilities are specialized software tools
(commands) e.g.,
ls, cp, grep, awk, bc, wc, more, rm, mkdir, ...
Daemons provide remote network and
administration services e.g.,
ssh (remote login)
lpd (remote printing)
httpd (serves web pages)
Unix Application
Pr ograms
This is the software that users commonly
interact with e.g.,
vi and emacs(text editors)
gcc(GNU C compiler)
javac (Java compiler)
java (Java run time virtual machine system)
W h a t i s a P r o g r a m m i n g
l a n g u a ge?
A programming language is an artificial
language designed to express computations
that will be executed on a computer
Programming languages have a syntax (form)
and semantics (meaning)
Java and C are example programming
languages
package com.javadb.examples;
import java.util.Arrays;
import java.util.List;
import java.util.Iterator;
public class Main {
public static void main(String[] args) {
String[] array = {"Programming", "is", "cool"};
List<String> list = Arrays.asList(array);
Iterator<String> iterator = list.iterator();
while (iterator.hasNext()) {
System.out.println(iterator.next());
}
}
}
What is a compiler?
A compiler is a computer program that transforms human readable
source code of another computer program into machine readable code
that a computer can execute.
The act of transforming source code into machine code is called
compilation.
Java Source Code
Java Compilation Process
Wha t i s a V i r t u a l
M a c h i n e ?
A virtual machine (VM) is a software implementation
of a computer that executes programs like a physical
computer
A system VM implements a complete computer that
can support the execution of a real OS(e.g., vmware,
KVM)
A process VM is designed to run a single program
(e.g., Java VM)
Improves program portability, i.e., the ability to
reuse software on a different platform with little or
no modification
Logging into Unix
login: <type your user id>
password: <type your password>
$ pwd
/home/spiros
$ exit
userid is the unique name of the user
password can be changed
password should only be known by user
system staff does not know user password, but
they have the power to change it
Unix is case sensitive
Logging into Unix
passwor ds ... do
make sure no one is looking while you enter
your password
change your password often
choose a password that you can remember
use at least 8 characters (letters) in your
password
Mix letters (upper and lower case) with digits
and punctuation
Passwor ds ... Don’t
use a word that can be found in a dictionary
use a name
keep your password written on a piece of
paper
use control characters
use personal information (e.g., address,
birthday, name of pet)
ever give your password to anybody
changing passwor d
Use the Unix passwd command
You will be prompted for both your current
password (once) and your new password
(twice)
change your initial password immediately
Logging out o f unix
logout leaves the system
exit quits the shell
^D same as logout, but often disabled
Unix Commands
$ command -optionstargets
man man (a manual on the Unix manual)
There should be a man page for every Unix
command e.g., man ls
Read the man pages, they are very useful and
convenient
Some Unix commands
passwd
date
hostname
who
last
finger
w
clear
cal
bc-l
history
ssh
Try these Unix
commands and see
what they do ...
The man pages can
give you details on
how to use these (and
other) commands
Unix Filesystem
Ordinary Files
Files contain data, program code, etc
File names cannot have the ‘/ ’ character in them
Directories
Contain files and other directories
Links
A link is a pointer reference to another file (like an alias)
Devices
Allows applications to access hardware devices
Unix Filesystem
HierAr chy
Unix DiRector ies
/ The "root" directory
/bin Essential low-level system utilities
/usr/bin Higher-level system utilities and application programs
/sbin Superuser system utilities (for performing system administration tasks)
Program libraries (collections of system calls that can be included in programs
by a compiler)for low-level system utilities
/lib
/usr/lib Program libraries for higher-level user programs
Temporary file storage space (can be used by any user)
User home directories containing personal file space for each
user. is named after the login of the user.
UNIX system configuration and information files
/tmp
/home Each directory
/etc
/dev Hardware devices
/proc A pseudo-filesystem which
directory for each
active
is used as an interface to the
kernel. program (or process).
Includes a sub-
Useful Unix
Filesystem commands
$ cd /usr/bin
root/ site/ tmp/ etc/ opt/ sbin/ srv/
usr /
$ man ls
$ pwd
/usr/bin
$ cd /
$ ls
bin/ lib/ media/
proc/ selinux/ sys/ var/ boot/ dev/ homes/ lib32/ mnt/
ls -l
• An example of the output is of ls -l is:
drwxr-xr-x 3 spiros serg 238 May 5 2:05 license.dat
◦ type is a single character which is either 'd' (directory), '-' (ordinary file), 'l' (symbolic link).
◦ permissions is a set of characters describing access rights. There are 9 permission characters, describing 3
access types given to 3 user categories. The three access types are read ('r'), write ('w') and execute ('x'),
and the three users categories are the user who owns the file, users in the group that the file belongs to and
other users (the general public).An 'r', 'w' or 'x' character means the corresponding permission is present;
a '-' means it is absent.
◦ links refers to the number of filesystem links pointing to the file or directory.
◦ owner is the user who created the file or directory.
◦ group denotes a collection of users who are allowed to access the file according to the group access
rights specified in the permissions field.
◦ size is the length of a file, or the number of bytes used by the operating system to store the list of files in a
directory.
◦ date is the date when the file or directory was last modified. The -u option display the time when the
file was last accessed (read).
◦ name is the name of the file or directory.
Useful Unix
Filesystem commands
cd path
(change directory to path)
mkdir directory
(make a new directory)
rmdir directory
(remove a directory)
cp source-filedestination-file
(copy source-file into destination-file)
cp source-file(s) destination-directory
(copy source files into destination-directory)
useful unix
filesystem commands
mv sourcedestination
(move/rename source file or directory to destination file or
directory)
rm file(s)
(remove/delete files)
rm -rf directory
(remove entire directory)
cat target-file(s)
(concatenate target files and display them on the screen)
cat target-file(s) > output.txt
(store concatenation to output file)
useful unix
filesystem commands
ln -s filename linkname
(create a pointer to filename and call it linkname)
cat ?piros
(concatenates all files that start with any character
and end with piros)
cat *
(concatenates all files in the current directory)
ls [a-c]*[x-z]
(lists files that start with a letter from a-c and end
with a letter from x-z)
File and Dir ector y
Per missions
chmod optionsfiles
for options u (user), g (group), o (other), a (all), r (read), w
(write), x (execute), + (add permission), - (remove
permission), = (assign permission)
What does chmod ug=rw, o-rw, a-x *.txt do?
How about chmod -R go+r dir ?
How about chmod 600 private.txt ?
chgrp group file(s)
(changes the group permissions for the files, works
with -R option)
UNIX File Commands
file filename(s)
(reports on the type of a file e.g., text, HTML, Java
source code)
head -num filename
(displays the first num lines of a file)
tail -num filename
(displays the last num lines of a file)
tail -f filename
(continuously outputs the last few lines of a file
being modified)
the unix f i n d
command
find directory -name targetfile-print
(look for targetfilein any part of the directory
rooted at directory), e.g.,
find /home -name “*.java” -print
which command
(gives path where the executable code of
command resides), e.g.,
which ls (should return / b in/ls)
unix gr ep command
grep optionspattern files
(searches the files for lines that match a given
pattern). e.g.,
grep Drexel *.txt
grep Drexel `find . -name “*.txt” -print`
grep -i drexel *.txt
unix sor t
command
sort filename(s)
(sorts line in a group of concatenated files
alphabetically)
sort -n filename(s)
(sorts line in a group of concatenated files
numerically)
uniq filename
(removes duplicate adjacent lines from a file)
sort in1.txt in2.txt > out.txt
unix file a r chiving
tar -cvf archivenamefilenames
(create archive from a list of files or directories)
tar -tvm archivename
(list contents of an archive)
tar -xvf archivename
(extract and restore archive)
tar -cvf code.tar src
tar -xvf code.tar
unix file compr ession
zip filename.zip directory/ *
(compresses contents of directory and store
them in filename.zip)
unzip filename.zip
(uncompress contents of filename.zip)
Other Unix compression tools are:
gzip
compress
Unix pr ocesses
You can get the status and process id of each
process running on the system
Check the man pages because options for ps
may vary from one Unix system to another
ps auxw
ps -ef
T
o terminate a process use the kill command
kill -9 process-id
Pr inting
lpr -Pprinterid filename
lpq -Pprinterid [job#] [userid]
lprm -Pprinterid [job#] [userid]
The vi text editor
(pr onounced V-I)
T
o run vi type the following on the command line:
$ vi filename
vi has three modes:
command mode:
to navigate through the document
insert mode:
to add text to the document
command line mode:
to perform manipulations on the files (e.g., search, save)
The Thr ee Modes o f vi
Line
Command
ZZ
Text
Insertion
Mode
Command
Mode
/
:
return
ESC
i
l
Moving the c u r s o r
You can use your arrow keys
Or you can use the h, j, k, l keys
h move left one space
j move down one space
k move up one space
l move right one space
You can move faster by typing 5 h to move left 5
spaces, etc
Moving the c u r s o r
^F go forward in the document by 1 screen
^B go backward in the document by 1 screen
^D go down in the document by half a screen
^U go up in the document by half a screen
Note that ^ means hold the control key down e.g.,
^F means hold the control key down and press F
.
The F
,B,D,U characters are non case sensitive
Moving the c u r s o r
G go to the last line in the file
n G go to the nth line in the file
$ go to the end of the current line
^ go to the beginning of current line
(use carat key not control key)
0 same as ^, go to beginning of current line
w forward one word, use n w to go forward n words
b backward one word, use n b to go backward n words
e go to end of the word
Inser ting text
i insert text before the cursor
a append text after the cursor
I insert text at the beginning of line
A append text at the end of line
o open new line after current line
O open new line before current line
Deleting text
dd delete current line
n dd delete n lines starting from the current line
dw delete word
n dw delete n next words
D delete from cursor to the end of current line
x delete current character
n x delete next n characters
X delete previous character (backspace)
changing text
cw change current word
n cw change n words starting at current word
c$ change from cursor to the end of line
~ change case of character
J join next line to the current line
u undo last command
n u undo last n commands
changing text
.
yy yank current line into a storage buffer (copy)
repeat last change
n yy yank next n lines into a storage buffer
yw yank current word into a storage buffer
n yw yank next n lines into a storage buffer
p put yanked buffer text (or deleted text) after cursor
P put yanked buffer text (or deleted text) before cursor
M a n i p u l ating files
:w write file to disk (save)
:wq write file to disk (save), then exit vi (quit)
:w! force overwrite of file
:q quit vi if no changes have been made
:q! quit vi without saving any of the changes
:! command escape to shell and run command
:r! command insert the result of command at
current cursor position

More Related Content

Similar to unix.ppt

Linux Notes-1.pdf
Linux Notes-1.pdfLinux Notes-1.pdf
Linux Notes-1.pdfasif64436
 
Karkha unix shell scritping
Karkha unix shell scritpingKarkha unix shell scritping
Karkha unix shell scritpingchockit88
 
Terminal basic-commands(Unix) -partI
Terminal basic-commands(Unix) -partITerminal basic-commands(Unix) -partI
Terminal basic-commands(Unix) -partIKedar Bhandari
 
Linux for beginners
Linux for beginnersLinux for beginners
Linux for beginnersNitesh Nayal
 
Introduction to Unix
Introduction to UnixIntroduction to Unix
Introduction to UnixSudharsan S
 
UNIT II-Programming in Linux
UNIT II-Programming in LinuxUNIT II-Programming in Linux
UNIT II-Programming in LinuxDr.YNM
 
Unit 1-a-brief-history-of-unix-ppt
Unit 1-a-brief-history-of-unix-pptUnit 1-a-brief-history-of-unix-ppt
Unit 1-a-brief-history-of-unix-pptRahul Mashal
 
Online Training in Unix Linux Shell Scripting in Hyderabad
Online Training in Unix Linux Shell Scripting in HyderabadOnline Training in Unix Linux Shell Scripting in Hyderabad
Online Training in Unix Linux Shell Scripting in HyderabadRavikumar Nandigam
 
Linuxppt
LinuxpptLinuxppt
LinuxpptReka
 
CSC103 Operating Systems, System Software, Powershell
CSC103 Operating Systems, System Software, PowershellCSC103 Operating Systems, System Software, Powershell
CSC103 Operating Systems, System Software, PowershellRichard Homa
 

Similar to unix.ppt (20)

cisco
ciscocisco
cisco
 
Nithi
NithiNithi
Nithi
 
Linux Notes-1.pdf
Linux Notes-1.pdfLinux Notes-1.pdf
Linux Notes-1.pdf
 
Karkha unix shell scritping
Karkha unix shell scritpingKarkha unix shell scritping
Karkha unix shell scritping
 
Terminal basic-commands(Unix) -partI
Terminal basic-commands(Unix) -partITerminal basic-commands(Unix) -partI
Terminal basic-commands(Unix) -partI
 
Linux for beginners
Linux for beginnersLinux for beginners
Linux for beginners
 
Introduction to Unix
Introduction to UnixIntroduction to Unix
Introduction to Unix
 
Spsl unit1
Spsl   unit1Spsl   unit1
Spsl unit1
 
UNIT II-Programming in Linux
UNIT II-Programming in LinuxUNIT II-Programming in Linux
UNIT II-Programming in Linux
 
Unit 1-a-brief-history-of-unix-ppt
Unit 1-a-brief-history-of-unix-pptUnit 1-a-brief-history-of-unix-ppt
Unit 1-a-brief-history-of-unix-ppt
 
Unix seminar
Unix seminarUnix seminar
Unix seminar
 
Linuxs1
Linuxs1Linuxs1
Linuxs1
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
 
Online Training in Unix Linux Shell Scripting in Hyderabad
Online Training in Unix Linux Shell Scripting in HyderabadOnline Training in Unix Linux Shell Scripting in Hyderabad
Online Training in Unix Linux Shell Scripting in Hyderabad
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
 
CSC103 Operating Systems, System Software, Powershell
CSC103 Operating Systems, System Software, PowershellCSC103 Operating Systems, System Software, Powershell
CSC103 Operating Systems, System Software, Powershell
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
 
Unix
UnixUnix
Unix
 
UNIX_Module 1.pdf
UNIX_Module 1.pdfUNIX_Module 1.pdf
UNIX_Module 1.pdf
 
Linux Commands
Linux CommandsLinux Commands
Linux Commands
 

More from jeronimored

Computer Networks 7.Physical LayerComputer Networks 7.Physical Layer
Computer Networks 7.Physical LayerComputer Networks 7.Physical LayerComputer Networks 7.Physical LayerComputer Networks 7.Physical Layer
Computer Networks 7.Physical LayerComputer Networks 7.Physical Layerjeronimored
 
Android – Open source mobile OS developed ny the Open Handset Alliance led by...
Android – Open source mobile OS developed ny the Open Handset Alliance led by...Android – Open source mobile OS developed ny the Open Handset Alliance led by...
Android – Open source mobile OS developed ny the Open Handset Alliance led by...jeronimored
 
Intel microprocessor history lec12_x86arch.ppt
Intel microprocessor history lec12_x86arch.pptIntel microprocessor history lec12_x86arch.ppt
Intel microprocessor history lec12_x86arch.pptjeronimored
 
Intro Ch 01BA business alliance consisting of 47 companies to develop open st...
Intro Ch 01BA business alliance consisting of 47 companies to develop open st...Intro Ch 01BA business alliance consisting of 47 companies to develop open st...
Intro Ch 01BA business alliance consisting of 47 companies to develop open st...jeronimored
 
preKnowledge-InternetNetworking Android's mobile operating system is based on...
preKnowledge-InternetNetworking Android's mobile operating system is based on...preKnowledge-InternetNetworking Android's mobile operating system is based on...
preKnowledge-InternetNetworking Android's mobile operating system is based on...jeronimored
 
TelecommunicationsThe Internet Basic Telecom Model
TelecommunicationsThe Internet Basic Telecom ModelTelecommunicationsThe Internet Basic Telecom Model
TelecommunicationsThe Internet Basic Telecom Modeljeronimored
 
Functional Areas of Network Management Configuration Management
Functional Areas of Network Management Configuration ManagementFunctional Areas of Network Management Configuration Management
Functional Areas of Network Management Configuration Managementjeronimored
 
Coding, Information Theory (and Advanced Modulation
Coding, Information Theory (and Advanced ModulationCoding, Information Theory (and Advanced Modulation
Coding, Information Theory (and Advanced Modulationjeronimored
 
8085microprocessorarchitectureppt-121013115356-phpapp02_2.ppt
8085microprocessorarchitectureppt-121013115356-phpapp02_2.ppt8085microprocessorarchitectureppt-121013115356-phpapp02_2.ppt
8085microprocessorarchitectureppt-121013115356-phpapp02_2.pptjeronimored
 
A microprocessor is the main component of a microcomputer system and is also ...
A microprocessor is the main component of a microcomputer system and is also ...A microprocessor is the main component of a microcomputer system and is also ...
A microprocessor is the main component of a microcomputer system and is also ...jeronimored
 
Erroneous co-routines can block system Formal interfaces slow down system
Erroneous co-routines can block system Formal  interfaces slow down systemErroneous co-routines can block system Formal  interfaces slow down system
Erroneous co-routines can block system Formal interfaces slow down systemjeronimored
 
Welcome to Introduction to Algorithms, Spring 2004
Welcome to Introduction to Algorithms, Spring 2004Welcome to Introduction to Algorithms, Spring 2004
Welcome to Introduction to Algorithms, Spring 2004jeronimored
 
Resource Management in (Embedded) Real-Time Systems
Resource Management in (Embedded) Real-Time SystemsResource Management in (Embedded) Real-Time Systems
Resource Management in (Embedded) Real-Time Systemsjeronimored
 
Management Tools Desirable features Management Architectures Simple Network ...
Management Tools  Desirable features Management Architectures Simple Network ...Management Tools  Desirable features Management Architectures Simple Network ...
Management Tools Desirable features Management Architectures Simple Network ...jeronimored
 
MICMicrowave Tubes – klystron, reflex klystron, magnetron and TWT.
MICMicrowave Tubes – klystron, reflex klystron, magnetron and TWT.MICMicrowave Tubes – klystron, reflex klystron, magnetron and TWT.
MICMicrowave Tubes – klystron, reflex klystron, magnetron and TWT.jeronimored
 
Network Management Network Management Model
Network Management Network Management ModelNetwork Management Network Management Model
Network Management Network Management Modeljeronimored
 
Saumya Debray The University of Arizona Tucson
Saumya Debray The University of Arizona TucsonSaumya Debray The University of Arizona Tucson
Saumya Debray The University of Arizona Tucsonjeronimored
 
An operating system (OS) provides a virtual execution environment on top of h...
An operating system (OS) provides a virtual execution environment on top of h...An operating system (OS) provides a virtual execution environment on top of h...
An operating system (OS) provides a virtual execution environment on top of h...jeronimored
 
application Fundamentals Android Introduction
application Fundamentals  Android Introductionapplication Fundamentals  Android Introduction
application Fundamentals Android Introductionjeronimored
 
linux-lecture1.ppt
linux-lecture1.pptlinux-lecture1.ppt
linux-lecture1.pptjeronimored
 

More from jeronimored (20)

Computer Networks 7.Physical LayerComputer Networks 7.Physical Layer
Computer Networks 7.Physical LayerComputer Networks 7.Physical LayerComputer Networks 7.Physical LayerComputer Networks 7.Physical Layer
Computer Networks 7.Physical LayerComputer Networks 7.Physical Layer
 
Android – Open source mobile OS developed ny the Open Handset Alliance led by...
Android – Open source mobile OS developed ny the Open Handset Alliance led by...Android – Open source mobile OS developed ny the Open Handset Alliance led by...
Android – Open source mobile OS developed ny the Open Handset Alliance led by...
 
Intel microprocessor history lec12_x86arch.ppt
Intel microprocessor history lec12_x86arch.pptIntel microprocessor history lec12_x86arch.ppt
Intel microprocessor history lec12_x86arch.ppt
 
Intro Ch 01BA business alliance consisting of 47 companies to develop open st...
Intro Ch 01BA business alliance consisting of 47 companies to develop open st...Intro Ch 01BA business alliance consisting of 47 companies to develop open st...
Intro Ch 01BA business alliance consisting of 47 companies to develop open st...
 
preKnowledge-InternetNetworking Android's mobile operating system is based on...
preKnowledge-InternetNetworking Android's mobile operating system is based on...preKnowledge-InternetNetworking Android's mobile operating system is based on...
preKnowledge-InternetNetworking Android's mobile operating system is based on...
 
TelecommunicationsThe Internet Basic Telecom Model
TelecommunicationsThe Internet Basic Telecom ModelTelecommunicationsThe Internet Basic Telecom Model
TelecommunicationsThe Internet Basic Telecom Model
 
Functional Areas of Network Management Configuration Management
Functional Areas of Network Management Configuration ManagementFunctional Areas of Network Management Configuration Management
Functional Areas of Network Management Configuration Management
 
Coding, Information Theory (and Advanced Modulation
Coding, Information Theory (and Advanced ModulationCoding, Information Theory (and Advanced Modulation
Coding, Information Theory (and Advanced Modulation
 
8085microprocessorarchitectureppt-121013115356-phpapp02_2.ppt
8085microprocessorarchitectureppt-121013115356-phpapp02_2.ppt8085microprocessorarchitectureppt-121013115356-phpapp02_2.ppt
8085microprocessorarchitectureppt-121013115356-phpapp02_2.ppt
 
A microprocessor is the main component of a microcomputer system and is also ...
A microprocessor is the main component of a microcomputer system and is also ...A microprocessor is the main component of a microcomputer system and is also ...
A microprocessor is the main component of a microcomputer system and is also ...
 
Erroneous co-routines can block system Formal interfaces slow down system
Erroneous co-routines can block system Formal  interfaces slow down systemErroneous co-routines can block system Formal  interfaces slow down system
Erroneous co-routines can block system Formal interfaces slow down system
 
Welcome to Introduction to Algorithms, Spring 2004
Welcome to Introduction to Algorithms, Spring 2004Welcome to Introduction to Algorithms, Spring 2004
Welcome to Introduction to Algorithms, Spring 2004
 
Resource Management in (Embedded) Real-Time Systems
Resource Management in (Embedded) Real-Time SystemsResource Management in (Embedded) Real-Time Systems
Resource Management in (Embedded) Real-Time Systems
 
Management Tools Desirable features Management Architectures Simple Network ...
Management Tools  Desirable features Management Architectures Simple Network ...Management Tools  Desirable features Management Architectures Simple Network ...
Management Tools Desirable features Management Architectures Simple Network ...
 
MICMicrowave Tubes – klystron, reflex klystron, magnetron and TWT.
MICMicrowave Tubes – klystron, reflex klystron, magnetron and TWT.MICMicrowave Tubes – klystron, reflex klystron, magnetron and TWT.
MICMicrowave Tubes – klystron, reflex klystron, magnetron and TWT.
 
Network Management Network Management Model
Network Management Network Management ModelNetwork Management Network Management Model
Network Management Network Management Model
 
Saumya Debray The University of Arizona Tucson
Saumya Debray The University of Arizona TucsonSaumya Debray The University of Arizona Tucson
Saumya Debray The University of Arizona Tucson
 
An operating system (OS) provides a virtual execution environment on top of h...
An operating system (OS) provides a virtual execution environment on top of h...An operating system (OS) provides a virtual execution environment on top of h...
An operating system (OS) provides a virtual execution environment on top of h...
 
application Fundamentals Android Introduction
application Fundamentals  Android Introductionapplication Fundamentals  Android Introduction
application Fundamentals Android Introduction
 
linux-lecture1.ppt
linux-lecture1.pptlinux-lecture1.ppt
linux-lecture1.ppt
 

Recently uploaded

“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 

Recently uploaded (20)

“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 

unix.ppt

  • 1. The Unix Operating System SE 101 Spiros Mancoridis
  • 2. Wha t i s a n OS? An operating system (OS)is software that manages the resources of a computer Like most managers, the OSaims to manage its resources in a safe and efficient way Examples of computer resources are: CPU, RAM, disk memory, printers, displays, keyboard, mouse, etc The OSalso isolates users and application programmers from the underlying computer
  • 4. OS Ar chitectur e Without an OS, every application would have to implement some part of this software hierarchy ...
  • 5. Unix A popular multi-user, multi-tasking OS Attributes: stability, portability, security Created at Bell Labs by Dennis Ritchie and Ken Thompson (won theACM Turing Award in 1983) Unix is considered one of the greatest achievements in computer science Has been around since the 1960s in various forms, e.g.,AIX, SCO Unix, SunOS, FreeBSD, OpenBSD, NetBSD, Linux, Mac OSX
  • 6. Unix Multiuser and Multitasking T oolbox philosophy Concise syntax Designed by programmers for programmers
  • 7. 1983ACM Tur ning Awar d (Unix) ACM is theAssociation for Computing Machinery World’s largest educational and scientific computer society You can become a student member too www.acm.org The ACM awards the Turing Award every year. It is the “Nobel Prize” of computing Named after british mathematician Alan M. Turing (1912-1954) Thompson and Ritchie Alan M. Turing
  • 8. Unix Ker nel Includes device drivers for computer hardware devices, e.g., graphics cards, network cards, disks A device driver is a program that allows computer programs to interact with hardware devices CPU and memory management File system management Implements system calls that can be used by application programs and system utilities
  • 9. What’s inside the Box? The von Neumann Architecture The OShides this complexity from the programmer
  • 10. Unix Shells and GUIS Shellsare used for command line input/ o utput to and from users e.g., sh (Bourne shell), bash (Bourne again shell), csh (C shell), ksh(Korn shell) GUIs are used for graphical I/ O e.g., Linux KDE, GNOME, Mac OSLeopard
  • 11. Unix System Utilities System utilities are specialized software tools (commands) e.g., ls, cp, grep, awk, bc, wc, more, rm, mkdir, ... Daemons provide remote network and administration services e.g., ssh (remote login) lpd (remote printing) httpd (serves web pages)
  • 12. Unix Application Pr ograms This is the software that users commonly interact with e.g., vi and emacs(text editors) gcc(GNU C compiler) javac (Java compiler) java (Java run time virtual machine system)
  • 13. W h a t i s a P r o g r a m m i n g l a n g u a ge? A programming language is an artificial language designed to express computations that will be executed on a computer Programming languages have a syntax (form) and semantics (meaning) Java and C are example programming languages
  • 14. package com.javadb.examples; import java.util.Arrays; import java.util.List; import java.util.Iterator; public class Main { public static void main(String[] args) { String[] array = {"Programming", "is", "cool"}; List<String> list = Arrays.asList(array); Iterator<String> iterator = list.iterator(); while (iterator.hasNext()) { System.out.println(iterator.next()); } } } What is a compiler? A compiler is a computer program that transforms human readable source code of another computer program into machine readable code that a computer can execute. The act of transforming source code into machine code is called compilation. Java Source Code Java Compilation Process
  • 15. Wha t i s a V i r t u a l M a c h i n e ? A virtual machine (VM) is a software implementation of a computer that executes programs like a physical computer A system VM implements a complete computer that can support the execution of a real OS(e.g., vmware, KVM) A process VM is designed to run a single program (e.g., Java VM) Improves program portability, i.e., the ability to reuse software on a different platform with little or no modification
  • 16. Logging into Unix login: <type your user id> password: <type your password> $ pwd /home/spiros $ exit
  • 17. userid is the unique name of the user password can be changed password should only be known by user system staff does not know user password, but they have the power to change it Unix is case sensitive Logging into Unix
  • 18. passwor ds ... do make sure no one is looking while you enter your password change your password often choose a password that you can remember use at least 8 characters (letters) in your password Mix letters (upper and lower case) with digits and punctuation
  • 19. Passwor ds ... Don’t use a word that can be found in a dictionary use a name keep your password written on a piece of paper use control characters use personal information (e.g., address, birthday, name of pet) ever give your password to anybody
  • 20. changing passwor d Use the Unix passwd command You will be prompted for both your current password (once) and your new password (twice) change your initial password immediately
  • 21. Logging out o f unix logout leaves the system exit quits the shell ^D same as logout, but often disabled
  • 22. Unix Commands $ command -optionstargets man man (a manual on the Unix manual) There should be a man page for every Unix command e.g., man ls Read the man pages, they are very useful and convenient
  • 23. Some Unix commands passwd date hostname who last finger w clear cal bc-l history ssh Try these Unix commands and see what they do ... The man pages can give you details on how to use these (and other) commands
  • 24. Unix Filesystem Ordinary Files Files contain data, program code, etc File names cannot have the ‘/ ’ character in them Directories Contain files and other directories Links A link is a pointer reference to another file (like an alias) Devices Allows applications to access hardware devices
  • 26. Unix DiRector ies / The "root" directory /bin Essential low-level system utilities /usr/bin Higher-level system utilities and application programs /sbin Superuser system utilities (for performing system administration tasks) Program libraries (collections of system calls that can be included in programs by a compiler)for low-level system utilities /lib /usr/lib Program libraries for higher-level user programs Temporary file storage space (can be used by any user) User home directories containing personal file space for each user. is named after the login of the user. UNIX system configuration and information files /tmp /home Each directory /etc /dev Hardware devices /proc A pseudo-filesystem which directory for each active is used as an interface to the kernel. program (or process). Includes a sub-
  • 27. Useful Unix Filesystem commands $ cd /usr/bin root/ site/ tmp/ etc/ opt/ sbin/ srv/ usr / $ man ls $ pwd /usr/bin $ cd / $ ls bin/ lib/ media/ proc/ selinux/ sys/ var/ boot/ dev/ homes/ lib32/ mnt/
  • 28. ls -l • An example of the output is of ls -l is: drwxr-xr-x 3 spiros serg 238 May 5 2:05 license.dat ◦ type is a single character which is either 'd' (directory), '-' (ordinary file), 'l' (symbolic link). ◦ permissions is a set of characters describing access rights. There are 9 permission characters, describing 3 access types given to 3 user categories. The three access types are read ('r'), write ('w') and execute ('x'), and the three users categories are the user who owns the file, users in the group that the file belongs to and other users (the general public).An 'r', 'w' or 'x' character means the corresponding permission is present; a '-' means it is absent. ◦ links refers to the number of filesystem links pointing to the file or directory. ◦ owner is the user who created the file or directory. ◦ group denotes a collection of users who are allowed to access the file according to the group access rights specified in the permissions field. ◦ size is the length of a file, or the number of bytes used by the operating system to store the list of files in a directory. ◦ date is the date when the file or directory was last modified. The -u option display the time when the file was last accessed (read). ◦ name is the name of the file or directory.
  • 29. Useful Unix Filesystem commands cd path (change directory to path) mkdir directory (make a new directory) rmdir directory (remove a directory) cp source-filedestination-file (copy source-file into destination-file) cp source-file(s) destination-directory (copy source files into destination-directory)
  • 30. useful unix filesystem commands mv sourcedestination (move/rename source file or directory to destination file or directory) rm file(s) (remove/delete files) rm -rf directory (remove entire directory) cat target-file(s) (concatenate target files and display them on the screen) cat target-file(s) > output.txt (store concatenation to output file)
  • 31. useful unix filesystem commands ln -s filename linkname (create a pointer to filename and call it linkname) cat ?piros (concatenates all files that start with any character and end with piros) cat * (concatenates all files in the current directory) ls [a-c]*[x-z] (lists files that start with a letter from a-c and end with a letter from x-z)
  • 32. File and Dir ector y Per missions chmod optionsfiles for options u (user), g (group), o (other), a (all), r (read), w (write), x (execute), + (add permission), - (remove permission), = (assign permission) What does chmod ug=rw, o-rw, a-x *.txt do? How about chmod -R go+r dir ? How about chmod 600 private.txt ? chgrp group file(s) (changes the group permissions for the files, works with -R option)
  • 33. UNIX File Commands file filename(s) (reports on the type of a file e.g., text, HTML, Java source code) head -num filename (displays the first num lines of a file) tail -num filename (displays the last num lines of a file) tail -f filename (continuously outputs the last few lines of a file being modified)
  • 34. the unix f i n d command find directory -name targetfile-print (look for targetfilein any part of the directory rooted at directory), e.g., find /home -name “*.java” -print which command (gives path where the executable code of command resides), e.g., which ls (should return / b in/ls)
  • 35. unix gr ep command grep optionspattern files (searches the files for lines that match a given pattern). e.g., grep Drexel *.txt grep Drexel `find . -name “*.txt” -print` grep -i drexel *.txt
  • 36. unix sor t command sort filename(s) (sorts line in a group of concatenated files alphabetically) sort -n filename(s) (sorts line in a group of concatenated files numerically) uniq filename (removes duplicate adjacent lines from a file) sort in1.txt in2.txt > out.txt
  • 37. unix file a r chiving tar -cvf archivenamefilenames (create archive from a list of files or directories) tar -tvm archivename (list contents of an archive) tar -xvf archivename (extract and restore archive) tar -cvf code.tar src tar -xvf code.tar
  • 38. unix file compr ession zip filename.zip directory/ * (compresses contents of directory and store them in filename.zip) unzip filename.zip (uncompress contents of filename.zip) Other Unix compression tools are: gzip compress
  • 39. Unix pr ocesses You can get the status and process id of each process running on the system Check the man pages because options for ps may vary from one Unix system to another ps auxw ps -ef T o terminate a process use the kill command kill -9 process-id
  • 40. Pr inting lpr -Pprinterid filename lpq -Pprinterid [job#] [userid] lprm -Pprinterid [job#] [userid]
  • 41. The vi text editor (pr onounced V-I) T o run vi type the following on the command line: $ vi filename vi has three modes: command mode: to navigate through the document insert mode: to add text to the document command line mode: to perform manipulations on the files (e.g., search, save)
  • 42. The Thr ee Modes o f vi Line Command ZZ Text Insertion Mode Command Mode / : return ESC i l
  • 43. Moving the c u r s o r You can use your arrow keys Or you can use the h, j, k, l keys h move left one space j move down one space k move up one space l move right one space You can move faster by typing 5 h to move left 5 spaces, etc
  • 44. Moving the c u r s o r ^F go forward in the document by 1 screen ^B go backward in the document by 1 screen ^D go down in the document by half a screen ^U go up in the document by half a screen Note that ^ means hold the control key down e.g., ^F means hold the control key down and press F . The F ,B,D,U characters are non case sensitive
  • 45. Moving the c u r s o r G go to the last line in the file n G go to the nth line in the file $ go to the end of the current line ^ go to the beginning of current line (use carat key not control key) 0 same as ^, go to beginning of current line w forward one word, use n w to go forward n words b backward one word, use n b to go backward n words e go to end of the word
  • 46. Inser ting text i insert text before the cursor a append text after the cursor I insert text at the beginning of line A append text at the end of line o open new line after current line O open new line before current line
  • 47. Deleting text dd delete current line n dd delete n lines starting from the current line dw delete word n dw delete n next words D delete from cursor to the end of current line x delete current character n x delete next n characters X delete previous character (backspace)
  • 48. changing text cw change current word n cw change n words starting at current word c$ change from cursor to the end of line ~ change case of character J join next line to the current line u undo last command n u undo last n commands
  • 49. changing text . yy yank current line into a storage buffer (copy) repeat last change n yy yank next n lines into a storage buffer yw yank current word into a storage buffer n yw yank next n lines into a storage buffer p put yanked buffer text (or deleted text) after cursor P put yanked buffer text (or deleted text) before cursor
  • 50. M a n i p u l ating files :w write file to disk (save) :wq write file to disk (save), then exit vi (quit) :w! force overwrite of file :q quit vi if no changes have been made :q! quit vi without saving any of the changes :! command escape to shell and run command :r! command insert the result of command at current cursor position