SlideShare uma empresa Scribd logo
1 de 85
UNIX an Overview
Emmanuel R. Mercado
 History of UNIX
 Introduction to OS concepts
 Introduction to Unix Operating System
 Unix System Architecture
 Introduction to Unix File System
 Starting to work with UNIX
2
Objective
3
 Ken Thompson of AT&T ,BELL laboratories
originally designed UNIX in late 1960s which
evolved from timesharing operating system called
multics.
 Originally written in assembly language but with
the development of ‘c’ programming language in
1973,it was then written in ‘c’.
 Two versions of UNIX emerged are AT&T Unix and
BSD Unix
History of UNIX
1989 AT&T and Sun Micro system joined together
and developed system V release 4 (SVR4)
Two of the main standards mainly in use are
POSIX(Portable Operating System Interface for
Computer Environment) and X for open standard
- Santa Cruze Operations Developed SCO UNIX
4
5
BSD :Berkeley, BSD
Solaris :Sun Microsystems, Sys 5/BSD
Ultrix :Digital Equipment Corporation, BSD
OSF 1 :Digital Equipment Corporation,
BSD/sys 5
HPUX :Hewlett-Packard, Sys 5
AIX : IBM, Sys 5 / BSD
IRIX : Silicon Graphics, Sys 5
GNU/Linux: GNU, BSD/Posix
 Is a System software
 Can be defined as
 An Organized collection of software consisting
of procedures for operating a computer
 Provides an environment for execution of
programs
 Acts as an interface between the user and the
hardware of the computer system.
6
Operating System
Operating system interacts with the user
in two ways Operating system calls
Provides an interface to a running
program and the operating system.
System calls in UNIX is written in C.
Operating system commands Enables
the user to interact directly with the
operating system.
7
Operating System
Multi-user
/multitasking/timesharing concept
Portability
Modularity
File structure
Security
Strong networking support
Advance graphics
8
Features of UNIX
9
hardware
kernel
shell
ld
as
comp
cp
vi
ed
grep
wc
date
a.out
who
sh
sort
ls
banner...
Layered Architecture
shell
shell
Unix System follows a layered Approach
It has four layers
The innermost layer is the hardware layer
In the second layer, the kernel is placed.
The utilities and the other application
programs form the third layer
Fourth layer is the one with which the
user actually interacts.
10
UNIX System Architecture
Kernel is that part of the OS which
directly makes interface with the
hardware system.
Factions:
Provides mechanism for creating and deleting
processes
Provides processor scheduling, memory and IO
management
Does interprocess communication.
11
Kernel
A Utility program that comes with the
unix system.
Features of Shell are:
Interactive Processing
Background Processing
I/O Redirection
Pipes
Shell Scripts
Shell Variables
Programming Constructs
12
The Shell
A process is a program in execution
Several processes can be executed
simultaneously in a UNIX system.
A process is generally created using the
―fork‖ system call.
The process that invoked the ―fork‖
system call is the parent process and the
newly created processed are called as
child processes
13
Process management
Unix uses ―Round-Robin‖ scheduling to
support its multi-user and time-sharing
feature.
Round-Robin fashion of scheduling is
considered to be oldest,simplest and widely
used algorithm.
Here, every process is given a time
slice(10-100 millisec.)
14
CPU Scheduling
15
dev bin tmp home etc lib usr
console
lp0
sh
ls
password
inittab bin
user1
user2
var
src
spool
File system
Unix uses a hierarchical file system with
―/‖ as its root.
Every non-leaf node of the tree is called
as a directory file.
Every leaf node can either be a file or an
empty directory
16
File management
17
Types of UNIX users
Super User
Group 1
Group 2
Owner Group
member
Group
member
others others others
 Log in
 Log out
18
Working with UNIX
To communicate with your computer you will require:
•a terminal with a full American Standard Code for Information Interchange
(ASCII) character set a data communication line to the computer
•a login ID
•a password
A terminal session begins by logging in through a recognized terminal and
ends by logging off. The computer will do work for you in response to the
commands that you enter during your terminal session.
The UNIX system identifies the many users on the system by their user
name (sometimes called the login ID). Your login, which is assigned to you
by your system administrator, is normally your name or initials. A password
may optionally be assigned to your account. If you forget your password, you
will have to ask your system administrator for assistance. Only the system
administrator has the authority to delete a user's password from his or her
account.
login : kumar
If a password has been allotted to you, the
system will flash the following message.
password :
The password will not be echoed on the
screen. If you enter an incorrect password or
login name it will display the message
Login incorrect
Login :
You will be permitted to reenter your
password a fixed number of times before you
get it right.
If your login information is right, it will
display a welcome message, Terminal type
and then show you the $ prompt
Terminal type is ansi $
19
When you have finished, you terminate your
terminal session by logging off. This frees
up the terminal so that another user can log
in. It is also recommended that you log off
when leaving your terminal unattended to
prohibit others from accessing your terminal
session and user account
20
21
pwd
Identifies the current working directory.
date
Displays the current date and time
who
Displays the names of all the users who have
currently logged in
who am i
Displays the name of the current user.
22
Simple commands
ls
Syntax :ls [options] [file….]
options:
-l list in long format
-a list all file including those
beginning with a dot
-i list inode no of file in first
column
-s reports disk blocks occupied
by file
-R recursively list all sub
directories
-F mark type of each file
-C display files in columns
23
Listing the directory contents
24
* 0 or more characters
? 1 character
[ - ] matches any one character between the brackets
[^ ] not matches any one character in the brackets
Meta characters
The Unix manual, usually called man pages, is available on-line
to explain the usage of the Unix system and commands. To use
a man page, type the command "man" at the system prompt
followed by the command for which you need information.
Syntax:
man [options] command_name
Common Options
-k keyword list command synopsis line for all keyword matches
-M path path to man pages
-a show all matching man pages (SVR4)
info command_name - help for the internal commands
help -–command_name– gives command synatx
25
Getting help about commands
 File Permissions
 Directory Related Commands
 File Related Commands
 Introduction to editors
27
Objectives
 Refers to the permissions associated with a file with
respect to the following
 Permission Levels
◦ User (owner) (u)
◦ Group (wheel, staff, daemon, etc.) (g)
◦ World (guest, anonymous and all other users) (o)
 Permission Settings
◦ Read (r)
◦ Write (w)
◦ Execute (x)
28
File access permissions
 No read permission does not allow the user to:
◦ List the contents of directory
◦ Remove the directory
 No Write permission does not allow the user to :
◦ copy files to the directory
◦ remove files from the directory
◦ rename files in the directory
◦ make a subdirectory
◦ remove a subdirectory from the directory
◦ move files to and from the directory
29
 No execute permission does not allow the user to:
◦ display the contents of a directory file from within the directory
◦ change to the directory
◦ display a file in the directory
◦ copy a file to or from the directory
30
chmod u+x file_name
Syntax:
chmod <category> <operation> <permission> <filename(s)>
Or
chmod <octal number> filename
Octal Number
r -4
w -2
x -1
$ chmod 744 xyz
this will set rwx for user, r– for group, r—for others
31
Changing permissions - chmod
$ ls –l
-rwxr-xr-x 1user1 training 12373 Dec 15 14:45 a.out
-rwxr-xr-x 3 user1 faculty 4096 Dec 24 11:56 awkpro
$chown user2 a.out
$ls –l
-rwxr-xr-x 1user2 training 12373 Dec 15 14:45 a.out
-rwxr-xr-x 3 user1 faculty 4096 Dec 24 11:56 awkpro
$ chgrp training awkpro
$ls –l
-rwxr-xr-x 1user2 training 12373 Dec 15 14:45 a.out
-rwxr-xr-x 3 user1 training 4096 Dec 24 11:56 awkpro
32
Command – chown & chgrp
umask value is used to set the default permission of a file and directory
while creating
umask command is used to see the default mask for the file
permission
Default umask value will be set in the system environment file like
/etc/profile
umask 022 will set a mask of 022 for the current session
◦ The file permission after setting this umask value will be 644
◦ And the directory permission will be 755
33
Command - umask
34
Command Syntax
mkdir [OPTION] DIRECTORY
$mkdir <path>/<directory>
$mkdir –m <directory>
$mkdir –p <directory1>/<directory2>/<directory3>
Example:
◦ mkdir project1
This creates a directory project1 under current directory
Note:
Write and execute permissions are needed for the user to
create a
directory
Directory creation
rmdir command removes directory
Syntax
◦ rmdir <directory name>
Example
Removes project1 directory in the current directory
◦ rmdir project1
Remove multiple directories
rmdir pos1 pos2
Remove the directory recursively
rmdir –p dir1/dir2/dir2
Rule: rmdir can be executed to a directory if it is empty and not the current
directory
35
Directory removal
FILE OPERATIONS
Copying a file
Moving a file
Removing a file
Displaying a file
COMMANDS
cp
mv
rm
cat
36
File related commands
Linking files
 Hard Link (in the same filesystem)
◦ $ ln /usr/bin/clear /usr/bin/cls
◦ Hard link uses the same inode number
 Soft Link (in different filesystems also
used to link directories)
◦ $ ln –s /usr/bin/clear /home/user1/cls
37
Command - ln
Used to copy files across directories
Syntax
cp <source file> <new file name>
Example
cp file1 file2
Note:
cp -r /dev/tty myfile
38
Command - cp
 -p
Copies the file and the following details
◦ owner id
◦ Group id
◦ permissions
◦ Last modification time
 -r
Recursive copy; copy subdirectories under the directory if any
39
Used to move a file or rename a file
Preserves the following details
◦ owner id
◦ group id
◦ permissions
◦ Last modification time
-f suppresses all prompting
-i prompts before overwriting destination file
40
Command - mv
Used to remove a file
◦ Syntax : rm file(s)
-f suppresses all prompting
-i prompts before deleting a file
-r will recursively remove the file from a directory (can be
used to delete a directory along with the content )
Caution: Use ―i‖ option along with ―r‖ to get notified on deletion
41
Command - rm
Vi is a visual editor used to enter and edit text files.
◦ A screen-oriented text editor
◦ Included with most UNIX system distributions
◦ Command driven
Categories of commands include
◦ General administration
◦ Cursor movement
◦ Insert text
◦ Delete text
◦ Paste text
◦ Modify text
The vi editor is invoked by the following command
◦ vi <filename>
42
vi editor
 Text insertion / replacement
◦ i - inserts text to the left of the
cursor
◦ a - inserts text to the right of the cursor
◦ I - inserts text at the beginning of
the line
◦ A - appends text at end of the line
◦ o - opens line below
◦ O - opens line above
◦ R - replaces text from cursor to right
◦ s - replaces a single character with any
number of characters
◦ S - replaces entire line
43
Editing commands
 Deletion
◦ -x - to delete character at cursor
position
◦ -3x - to delete 3 characters at
cursor position
◦ dw - to delete word
◦ -2dw - to delete 2 word
◦ dd - to delete a line
◦ 2dd - to delete 2 lines
44
Editing commands
 Yanking
◦ Y - copy line into buffer
◦ 3Y - copy 3 lines into buffer
◦ p - copy buffer below cursor
◦ P - copy buffer above cursor
 Save and quit
◦ :w - to save
◦ :w! - to name a file (:w! filename -
> save as)
◦ :x- save and quit
◦ :q - cancel changes
◦ :q! - cancel and quit
45
Editing commands
Syntax:-
:s/old/new to substitute 'new' for 'old'.
Example:-
:s/thee/the change the first occurrence of
thee with the.
:s/thee/the/g substitute globally thee with the
To change every occurrence of a character string between two
lines,
:#,#s/old/new/g where #,# are replaced with the numbers
of the two lines.
46
Search & replace commands
 :set number
 :set nonumber
 :set ignorecase
 :set nomagic
47
Customizing vi
Backspace
h
Space
lj k
thequickbrownfox
ww w
thequickbrownfox
2w
thequickbrownfox
bb b
thequickbrownfox
$
thequickbrownfox
^
48
Navigation
General purpose utilities
◦ cat, echo, touch, more, file, wc, cmp, comm, find, banner,
cal etc..
Redirection operators
Filters
50
cat is concatenate files and print on the standard output
cat command takes the input from the keyboard and send the output
to the monitor
We can redirect the input and output using the redirection operators
◦ $ cat>file1
◦ Type the content here
◦ press <ctrl d>
◦ $ cat file1
◦ Displays the content of the file
◦ $cat>>file1
◦ Will append to the content of the file
51
cat
Syntax: touch [options] file
Options:
◦ a to change the access time
◦ m to change the modification time
◦ c no create if not exists
touch is used to change the time stamp of the file
Touch <file> will change the time of change of the file is the file exists
If the file is not existing it will create a file of zero size
52
touch
echo command is used to print an output to the screen
echo ―This is an example‖
This is an example
x=10
echo $x
10
53
echo
more
◦ Allows the user to view one page full of information at a time.
file
◦ Used to display the type of the file
tty
◦ Prints the terminals name
54
General purpose utilities
wc
◦ A filter used to count the number of lines,words and characters in a disk file or
in the standard input.
◦ -l - displays the number of lines
◦ -w - displays the number of words
◦ -c - displays the number of characters
55
General purpose utilities
cmp
◦ Returns the offset and the line number and the line number of the first position
where the two files differs.
comm
◦ col1 - unique lines of first file
◦ col2 - unique lines of second file
◦ col3 - common lines
56
General purpose utilities
diff
◦ Indicate the differences between the files
◦ a Lines added
◦ d Lines deleted
◦ c Lines changed
57
General purpose utilities
find
◦ Used to locate a file or a directory in the given path
Usage
◦ find <path> [options]
Options
◦ name - accepts the format to searched
◦ print displays the path on the screen
58
General purpose utilities
pr
◦ Used to display a file in a format to be printed.
◦ Breaks up a file into pages with a header, text and footer area
Options
◦ -l to alter the length of the file
◦ -h to set the header
◦ -t to suppress the header and the footer
59
General purpose utilities
Standard Input file
◦ Keyboard , file descriptor is 0
Standard Output file
◦ Monitor , file descriptor is 1
Standard Error file
◦ Monitor, file descriptor is 2
60
Standard files
< file redirect standard input from file
> file redirect standard output to file
2> file redirect standard error to file
2>&1 merge standard error with standard
output
$ cat > abc
$ ls –l > outfile
$ cat xyz abc > outfile 2> errfile
$ cat xyz abc > outfile 2>&1
61
I/O redirection
Filters are programs that takes its input from the std i/p
file, processes it and sends it to the std o/p file.
Commonly used filter commands
◦ sort
◦ grep
◦ cut
◦ head
◦ tail
◦ paste
62
Filters
Grep -Global Regular Expression Printer
Is used for searching regular expressions
Syntax
◦ grep <options> <pattern> <filename(s)>
63
grep
64
-c displays count of the number of occurrences
-n displays line numbers along with the lines
-v displays all lines except lines matching pattern
-i Ignores case for matching
grep options
* - matches 0 or more characters
[^pqr] - Matches a single character which is not p ,q or r
^pqr -Matches pqr at the beginning of the line
pqr$ -Matches pqr at the end of the file
―.‖ - Matches any one character
 - ignores the special meaning.
◦ Grep ―New[abc]‖ filename
65
patterns
Displays the top n lines of the file
Can specify top n lines to be displayed
$ head -3 file1
66
Filter command - head
Displays the end of the file
Can specify last n lines to be displayed
$ tail -3 file1
Can also specify the line number from which the data has to be
displayed
$ tail +5 file1
67
Filter command - tail
 Allows the output (only the standard output) of a
command to be sent as input to another command.
 Multiple pipes may appear in one command line.
Example:
$ cat * | wc
$ cat fil1 | head | wc -l
68
Command piping
 tee command allows the normal output
to the standard output, as well as to a
file
 Useful to capture intermediate output of
a long command pipeline for further
processing or debugging purpose.
Example
◦ who | tee userlist
69
Filter command – tee
Paste is used to fix two cut portions of the file vertically
-s -->Pastes the contents of file2 below file1
-d -->Specify delimiter
$ paste -d‖|‖ file1 file2
70
Filter command – paste
71
telnet hostname
Allows a connection to host from any other machine connected to the
Internet. node itself will prompt for a logon name, then the password.
Logging on remotely allows users to use the UNIX/Linux commands,
but not the Graphics User Interface of the remote machine.
rlogin Bypassing Password - (non-secure)
rlogin: rlogin node
Allows a connection to node without the use of a password. For this
to be true, two things must be properly set.
1.You must have an account (of the same name) on the remote system.
2.File .rhosts on the remote system must contain the name of the local
system, followed by your account name.
telnet: Connecting to Remote Systems
72
ftp hostname
put/send: Transfer to Other hosts
put [local_file [remote_file]]
get/recv: Transfer From Other hosts
get [remote_file [local_file]]
mput: Multiple Transfer to Other hosts
It will prompt for every file to be transferred, unless the -i flag was used
on the ftp command line, or the prompt command is issued.
mput is very useful when moving a number of files.
FTP
73
gzip,
Usage is very similar to compress and pack utilities in unix:
gzip [-vc] filename
where -v displays the compression ratio.
-c sends the compressed output to standard output and
leaves the original file intact.
Gunzip
gunzip can uncompress files originally compressed with
compress.
Compression utilities
74
tar is a utility that packs a list of files (and/or directories)
into a specific tarfile, whose name typically ends in
.tar.
tar is invoked by
tar -c|t|x [vof destination] source...
where destination is the name of the tape device or tar file,
and source... may be files and/or directories combined
to produce the tar file. One of c, t, or x must be used.
tar – tape archive
75
-c (create): creates a new tarfile.
-t (table): lists the files on the tarfile.
-x (extract): extracts the files from the tarfile.
-v (verbose): the size and name of each file put onto or extracted
from the tarfile is displayed.
-o (ownership): on the extraction of files, do NOT extract the
original ownership of the files and directories. This avoids the
message permission denied when reading tar_files.
-f (destination): uses the next argument as the name of the tarfile.
It is normally in the form filename.tar (but could also be a device
name, such as /dev/8mm).
tar – tape archive
Process related commands
◦ ps
◦ kill
◦ wait
◦ sleep
77
Processes
 Process - a program in execution
 When program is executed , a new process is created
 The process is alive till the execution of the program is
complete
 Each process is identified by a number called pid.
78
Processes
As soon as the user logs in, a process is created which
executes the login shell.
Login shell is set for each login in /etc/passwd directory.
79
Login shell
The ps command is used to display the characteristics of a
process
It fetches the pid, tty, time and the command which has started
the process.
◦ -f lists the pid of the parent process also.
◦ -u lists the processes of a given user
◦ -a lists the processes of all the users
◦ -e lists all the processes including the system processes
80
ps
Enables the user to do more than one task at a time.
If the command terminates with a & UNIX executes the command at
the background
81
Background process
jobs
◦ List the background process
fg %
◦ Runs a process in the foreground
bg %
◦ Runs a process in the background
nice
82
Controlling background processes
 kill : Kills or terminates a process
 Kill command send a signal to the process
◦ The default signal is 15 ( SIGTERM)
 Kill -9 (SIGKILL)
◦ Terminates the process abruptly
83
kill command
 Sample entries
root:x:0:0:root:/root:/bin/bash
xfs:x:43:43:X Font Server:/etc/X11/fs:/bin/false
suresh:x:500:500:SURESH:/home/suresh:/bin/bash
perumal:x:501:501::/home/perumal:/bin/bash
user:x:502:502::/home/user:/bin/bash
user1:x:503:503::/home/user1:/bin/bash
84
/etc/passwd file
Thank You

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

SHELL PROGRAMMING
SHELL PROGRAMMINGSHELL PROGRAMMING
SHELL PROGRAMMING
 
Operating systems unix
Operating systems   unixOperating systems   unix
Operating systems unix
 
Linux operating system - Overview
Linux operating system - OverviewLinux operating system - Overview
Linux operating system - Overview
 
Os ppt
Os pptOs ppt
Os ppt
 
Linux ppt
Linux pptLinux ppt
Linux ppt
 
Linux
Linux Linux
Linux
 
Linux basic commands with examples
Linux basic commands with examplesLinux basic commands with examples
Linux basic commands with examples
 
Linux file system
Linux file systemLinux file system
Linux file system
 
Linux basics
Linux basicsLinux basics
Linux basics
 
Linux systems - Linux Commands and Shell Scripting
Linux systems - Linux Commands and Shell ScriptingLinux systems - Linux Commands and Shell Scripting
Linux systems - Linux Commands and Shell Scripting
 
Introduction to linux ppt
Introduction to linux pptIntroduction to linux ppt
Introduction to linux ppt
 
UNIX Operating System
UNIX Operating SystemUNIX Operating System
UNIX Operating System
 
Introduction to Unix
Introduction to UnixIntroduction to Unix
Introduction to Unix
 
Operating systems
Operating systems Operating systems
Operating systems
 
Unix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell ScriptUnix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell Script
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Linux.ppt
Linux.ppt Linux.ppt
Linux.ppt
 
Linux command ppt
Linux command pptLinux command ppt
Linux command ppt
 
Linux - Introductions to Linux Operating System
Linux - Introductions to Linux Operating SystemLinux - Introductions to Linux Operating System
Linux - Introductions to Linux Operating System
 
Unix operating system architecture with file structure
Unix operating system architecture with file structure Unix operating system architecture with file structure
Unix operating system architecture with file structure
 

Destaque

Unix(introduction)
Unix(introduction)Unix(introduction)
Unix(introduction)
meashi
 
Unix memory management
Unix memory managementUnix memory management
Unix memory management
Tech_MX
 
Ch4(saving state with cookies and query strings)
Ch4(saving state with cookies and query strings)Ch4(saving state with cookies and query strings)
Ch4(saving state with cookies and query strings)
Chhom Karath
 

Destaque (20)

Basic Unix
Basic UnixBasic Unix
Basic Unix
 
intro unix/linux 02
intro unix/linux 02intro unix/linux 02
intro unix/linux 02
 
QSpiders - Unix Operating Systems and Commands
QSpiders - Unix Operating Systems  and CommandsQSpiders - Unix Operating Systems  and Commands
QSpiders - Unix Operating Systems and Commands
 
Unix(introduction)
Unix(introduction)Unix(introduction)
Unix(introduction)
 
Unix Command Line Productivity Tips
Unix Command Line Productivity TipsUnix Command Line Productivity Tips
Unix Command Line Productivity Tips
 
Unix OS & Commands
Unix OS & CommandsUnix OS & Commands
Unix OS & Commands
 
UNIX and Linux - an introduction by Mathias Homann
UNIX and Linux - an introduction by Mathias HomannUNIX and Linux - an introduction by Mathias Homann
UNIX and Linux - an introduction by Mathias Homann
 
Unix memory management
Unix memory managementUnix memory management
Unix memory management
 
Unix
UnixUnix
Unix
 
Unix Operating System
Unix Operating SystemUnix Operating System
Unix Operating System
 
UNIX/Linux training
UNIX/Linux trainingUNIX/Linux training
UNIX/Linux training
 
Apache
Apache Apache
Apache
 
Know the UNIX Commands
Know the UNIX CommandsKnow the UNIX Commands
Know the UNIX Commands
 
Unix Training - 1
Unix Training - 1Unix Training - 1
Unix Training - 1
 
Introduction to unix
Introduction to unixIntroduction to unix
Introduction to unix
 
Unix Process management
Unix Process managementUnix Process management
Unix Process management
 
Unix slideshare
Unix slideshareUnix slideshare
Unix slideshare
 
Introduction to UNIX Command-Lines with examples
Introduction to UNIX Command-Lines with examplesIntroduction to UNIX Command-Lines with examples
Introduction to UNIX Command-Lines with examples
 
Application of dual output LiDAR scanning system for power transmission line ...
Application of dual output LiDAR scanning system for power transmission line ...Application of dual output LiDAR scanning system for power transmission line ...
Application of dual output LiDAR scanning system for power transmission line ...
 
Ch4(saving state with cookies and query strings)
Ch4(saving state with cookies and query strings)Ch4(saving state with cookies and query strings)
Ch4(saving state with cookies and query strings)
 

Semelhante a Unix

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
Ravikumar Nandigam
 
Introduction to Unix
Introduction to UnixIntroduction to Unix
Introduction to Unix
Sudharsan S
 
LINUX
LINUXLINUX
LINUX
ARJUN
 
Linux introductory-course-day-1
Linux introductory-course-day-1Linux introductory-course-day-1
Linux introductory-course-day-1
Julio Pulido
 

Semelhante a Unix (20)

Unix notes
Unix notesUnix notes
Unix notes
 
Chapter 2 Introduction to Unix Concepts
Chapter 2 Introduction to Unix ConceptsChapter 2 Introduction to Unix Concepts
Chapter 2 Introduction to Unix Concepts
 
Unix_Introduction_BCA.pptx the very basi
Unix_Introduction_BCA.pptx the very basiUnix_Introduction_BCA.pptx the very basi
Unix_Introduction_BCA.pptx the very basi
 
Basics of Linux Commands, Git and Github
Basics of Linux Commands, Git and GithubBasics of Linux Commands, Git and Github
Basics of Linux Commands, Git and Github
 
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
 
unix.ppt
unix.pptunix.ppt
unix.ppt
 
Linux for beginners
Linux for beginnersLinux for beginners
Linux for beginners
 
Introduction to Unix
Introduction to UnixIntroduction to Unix
Introduction to Unix
 
Linux Basics.pptx
Linux Basics.pptxLinux Basics.pptx
Linux Basics.pptx
 
LINUX
LINUXLINUX
LINUX
 
Chapter 2 unix system commands
Chapter 2 unix system commandsChapter 2 unix system commands
Chapter 2 unix system commands
 
Unix Shell Script - 2 Days Session.pptx
Unix Shell Script - 2 Days Session.pptxUnix Shell Script - 2 Days Session.pptx
Unix Shell Script - 2 Days Session.pptx
 
lec1.docx
lec1.docxlec1.docx
lec1.docx
 
Nithi
NithiNithi
Nithi
 
Introduction to unix
Introduction to unixIntroduction to unix
Introduction to unix
 
Linux introductory-course-day-1
Linux introductory-course-day-1Linux introductory-course-day-1
Linux introductory-course-day-1
 
60761 linux
60761 linux60761 linux
60761 linux
 
Most frequently used unix commands for database administrator
Most frequently used unix commands for database administratorMost frequently used unix commands for database administrator
Most frequently used unix commands for database administrator
 
Programming Embedded linux
Programming Embedded linuxProgramming Embedded linux
Programming Embedded linux
 
UNIX.ppt
UNIX.pptUNIX.ppt
UNIX.ppt
 

Mais de Erm78 (12)

2nd
2nd2nd
2nd
 
2nd
2nd2nd
2nd
 
5th
5th5th
5th
 
4th
4th4th
4th
 
3rd
3rd3rd
3rd
 
8 th
8 th8 th
8 th
 
7 th
7 th7 th
7 th
 
9 th
9 th9 th
9 th
 
6 th
6 th6 th
6 th
 
Dos
DosDos
Dos
 
Ordonio
OrdonioOrdonio
Ordonio
 
Tamaray ACT22A
Tamaray ACT22ATamaray ACT22A
Tamaray ACT22A
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 

Unix

  • 2.  History of UNIX  Introduction to OS concepts  Introduction to Unix Operating System  Unix System Architecture  Introduction to Unix File System  Starting to work with UNIX 2 Objective
  • 3. 3  Ken Thompson of AT&T ,BELL laboratories originally designed UNIX in late 1960s which evolved from timesharing operating system called multics.  Originally written in assembly language but with the development of ‘c’ programming language in 1973,it was then written in ‘c’.  Two versions of UNIX emerged are AT&T Unix and BSD Unix History of UNIX
  • 4. 1989 AT&T and Sun Micro system joined together and developed system V release 4 (SVR4) Two of the main standards mainly in use are POSIX(Portable Operating System Interface for Computer Environment) and X for open standard - Santa Cruze Operations Developed SCO UNIX 4
  • 5. 5 BSD :Berkeley, BSD Solaris :Sun Microsystems, Sys 5/BSD Ultrix :Digital Equipment Corporation, BSD OSF 1 :Digital Equipment Corporation, BSD/sys 5 HPUX :Hewlett-Packard, Sys 5 AIX : IBM, Sys 5 / BSD IRIX : Silicon Graphics, Sys 5 GNU/Linux: GNU, BSD/Posix
  • 6.  Is a System software  Can be defined as  An Organized collection of software consisting of procedures for operating a computer  Provides an environment for execution of programs  Acts as an interface between the user and the hardware of the computer system. 6 Operating System
  • 7. Operating system interacts with the user in two ways Operating system calls Provides an interface to a running program and the operating system. System calls in UNIX is written in C. Operating system commands Enables the user to interact directly with the operating system. 7 Operating System
  • 10. Unix System follows a layered Approach It has four layers The innermost layer is the hardware layer In the second layer, the kernel is placed. The utilities and the other application programs form the third layer Fourth layer is the one with which the user actually interacts. 10 UNIX System Architecture
  • 11. Kernel is that part of the OS which directly makes interface with the hardware system. Factions: Provides mechanism for creating and deleting processes Provides processor scheduling, memory and IO management Does interprocess communication. 11 Kernel
  • 12. A Utility program that comes with the unix system. Features of Shell are: Interactive Processing Background Processing I/O Redirection Pipes Shell Scripts Shell Variables Programming Constructs 12 The Shell
  • 13. A process is a program in execution Several processes can be executed simultaneously in a UNIX system. A process is generally created using the ―fork‖ system call. The process that invoked the ―fork‖ system call is the parent process and the newly created processed are called as child processes 13 Process management
  • 14. Unix uses ―Round-Robin‖ scheduling to support its multi-user and time-sharing feature. Round-Robin fashion of scheduling is considered to be oldest,simplest and widely used algorithm. Here, every process is given a time slice(10-100 millisec.) 14 CPU Scheduling
  • 15. 15 dev bin tmp home etc lib usr console lp0 sh ls password inittab bin user1 user2 var src spool File system
  • 16. Unix uses a hierarchical file system with ―/‖ as its root. Every non-leaf node of the tree is called as a directory file. Every leaf node can either be a file or an empty directory 16 File management
  • 17. 17 Types of UNIX users Super User Group 1 Group 2 Owner Group member Group member others others others
  • 18.  Log in  Log out 18 Working with UNIX To communicate with your computer you will require: •a terminal with a full American Standard Code for Information Interchange (ASCII) character set a data communication line to the computer •a login ID •a password A terminal session begins by logging in through a recognized terminal and ends by logging off. The computer will do work for you in response to the commands that you enter during your terminal session. The UNIX system identifies the many users on the system by their user name (sometimes called the login ID). Your login, which is assigned to you by your system administrator, is normally your name or initials. A password may optionally be assigned to your account. If you forget your password, you will have to ask your system administrator for assistance. Only the system administrator has the authority to delete a user's password from his or her account. login : kumar
  • 19. If a password has been allotted to you, the system will flash the following message. password : The password will not be echoed on the screen. If you enter an incorrect password or login name it will display the message Login incorrect Login : You will be permitted to reenter your password a fixed number of times before you get it right. If your login information is right, it will display a welcome message, Terminal type and then show you the $ prompt Terminal type is ansi $ 19
  • 20. When you have finished, you terminate your terminal session by logging off. This frees up the terminal so that another user can log in. It is also recommended that you log off when leaving your terminal unattended to prohibit others from accessing your terminal session and user account 20
  • 21. 21
  • 22. pwd Identifies the current working directory. date Displays the current date and time who Displays the names of all the users who have currently logged in who am i Displays the name of the current user. 22 Simple commands
  • 23. ls Syntax :ls [options] [file….] options: -l list in long format -a list all file including those beginning with a dot -i list inode no of file in first column -s reports disk blocks occupied by file -R recursively list all sub directories -F mark type of each file -C display files in columns 23 Listing the directory contents
  • 24. 24 * 0 or more characters ? 1 character [ - ] matches any one character between the brackets [^ ] not matches any one character in the brackets Meta characters
  • 25. The Unix manual, usually called man pages, is available on-line to explain the usage of the Unix system and commands. To use a man page, type the command "man" at the system prompt followed by the command for which you need information. Syntax: man [options] command_name Common Options -k keyword list command synopsis line for all keyword matches -M path path to man pages -a show all matching man pages (SVR4) info command_name - help for the internal commands help -–command_name– gives command synatx 25 Getting help about commands
  • 26.
  • 27.  File Permissions  Directory Related Commands  File Related Commands  Introduction to editors 27 Objectives
  • 28.  Refers to the permissions associated with a file with respect to the following  Permission Levels ◦ User (owner) (u) ◦ Group (wheel, staff, daemon, etc.) (g) ◦ World (guest, anonymous and all other users) (o)  Permission Settings ◦ Read (r) ◦ Write (w) ◦ Execute (x) 28 File access permissions
  • 29.  No read permission does not allow the user to: ◦ List the contents of directory ◦ Remove the directory  No Write permission does not allow the user to : ◦ copy files to the directory ◦ remove files from the directory ◦ rename files in the directory ◦ make a subdirectory ◦ remove a subdirectory from the directory ◦ move files to and from the directory 29
  • 30.  No execute permission does not allow the user to: ◦ display the contents of a directory file from within the directory ◦ change to the directory ◦ display a file in the directory ◦ copy a file to or from the directory 30
  • 31. chmod u+x file_name Syntax: chmod <category> <operation> <permission> <filename(s)> Or chmod <octal number> filename Octal Number r -4 w -2 x -1 $ chmod 744 xyz this will set rwx for user, r– for group, r—for others 31 Changing permissions - chmod
  • 32. $ ls –l -rwxr-xr-x 1user1 training 12373 Dec 15 14:45 a.out -rwxr-xr-x 3 user1 faculty 4096 Dec 24 11:56 awkpro $chown user2 a.out $ls –l -rwxr-xr-x 1user2 training 12373 Dec 15 14:45 a.out -rwxr-xr-x 3 user1 faculty 4096 Dec 24 11:56 awkpro $ chgrp training awkpro $ls –l -rwxr-xr-x 1user2 training 12373 Dec 15 14:45 a.out -rwxr-xr-x 3 user1 training 4096 Dec 24 11:56 awkpro 32 Command – chown & chgrp
  • 33. umask value is used to set the default permission of a file and directory while creating umask command is used to see the default mask for the file permission Default umask value will be set in the system environment file like /etc/profile umask 022 will set a mask of 022 for the current session ◦ The file permission after setting this umask value will be 644 ◦ And the directory permission will be 755 33 Command - umask
  • 34. 34 Command Syntax mkdir [OPTION] DIRECTORY $mkdir <path>/<directory> $mkdir –m <directory> $mkdir –p <directory1>/<directory2>/<directory3> Example: ◦ mkdir project1 This creates a directory project1 under current directory Note: Write and execute permissions are needed for the user to create a directory Directory creation
  • 35. rmdir command removes directory Syntax ◦ rmdir <directory name> Example Removes project1 directory in the current directory ◦ rmdir project1 Remove multiple directories rmdir pos1 pos2 Remove the directory recursively rmdir –p dir1/dir2/dir2 Rule: rmdir can be executed to a directory if it is empty and not the current directory 35 Directory removal
  • 36. FILE OPERATIONS Copying a file Moving a file Removing a file Displaying a file COMMANDS cp mv rm cat 36 File related commands
  • 37. Linking files  Hard Link (in the same filesystem) ◦ $ ln /usr/bin/clear /usr/bin/cls ◦ Hard link uses the same inode number  Soft Link (in different filesystems also used to link directories) ◦ $ ln –s /usr/bin/clear /home/user1/cls 37 Command - ln
  • 38. Used to copy files across directories Syntax cp <source file> <new file name> Example cp file1 file2 Note: cp -r /dev/tty myfile 38 Command - cp
  • 39.  -p Copies the file and the following details ◦ owner id ◦ Group id ◦ permissions ◦ Last modification time  -r Recursive copy; copy subdirectories under the directory if any 39
  • 40. Used to move a file or rename a file Preserves the following details ◦ owner id ◦ group id ◦ permissions ◦ Last modification time -f suppresses all prompting -i prompts before overwriting destination file 40 Command - mv
  • 41. Used to remove a file ◦ Syntax : rm file(s) -f suppresses all prompting -i prompts before deleting a file -r will recursively remove the file from a directory (can be used to delete a directory along with the content ) Caution: Use ―i‖ option along with ―r‖ to get notified on deletion 41 Command - rm
  • 42. Vi is a visual editor used to enter and edit text files. ◦ A screen-oriented text editor ◦ Included with most UNIX system distributions ◦ Command driven Categories of commands include ◦ General administration ◦ Cursor movement ◦ Insert text ◦ Delete text ◦ Paste text ◦ Modify text The vi editor is invoked by the following command ◦ vi <filename> 42 vi editor
  • 43.  Text insertion / replacement ◦ i - inserts text to the left of the cursor ◦ a - inserts text to the right of the cursor ◦ I - inserts text at the beginning of the line ◦ A - appends text at end of the line ◦ o - opens line below ◦ O - opens line above ◦ R - replaces text from cursor to right ◦ s - replaces a single character with any number of characters ◦ S - replaces entire line 43 Editing commands
  • 44.  Deletion ◦ -x - to delete character at cursor position ◦ -3x - to delete 3 characters at cursor position ◦ dw - to delete word ◦ -2dw - to delete 2 word ◦ dd - to delete a line ◦ 2dd - to delete 2 lines 44 Editing commands
  • 45.  Yanking ◦ Y - copy line into buffer ◦ 3Y - copy 3 lines into buffer ◦ p - copy buffer below cursor ◦ P - copy buffer above cursor  Save and quit ◦ :w - to save ◦ :w! - to name a file (:w! filename - > save as) ◦ :x- save and quit ◦ :q - cancel changes ◦ :q! - cancel and quit 45 Editing commands
  • 46. Syntax:- :s/old/new to substitute 'new' for 'old'. Example:- :s/thee/the change the first occurrence of thee with the. :s/thee/the/g substitute globally thee with the To change every occurrence of a character string between two lines, :#,#s/old/new/g where #,# are replaced with the numbers of the two lines. 46 Search & replace commands
  • 47.  :set number  :set nonumber  :set ignorecase  :set nomagic 47 Customizing vi
  • 48. Backspace h Space lj k thequickbrownfox ww w thequickbrownfox 2w thequickbrownfox bb b thequickbrownfox $ thequickbrownfox ^ 48 Navigation
  • 49.
  • 50. General purpose utilities ◦ cat, echo, touch, more, file, wc, cmp, comm, find, banner, cal etc.. Redirection operators Filters 50
  • 51. cat is concatenate files and print on the standard output cat command takes the input from the keyboard and send the output to the monitor We can redirect the input and output using the redirection operators ◦ $ cat>file1 ◦ Type the content here ◦ press <ctrl d> ◦ $ cat file1 ◦ Displays the content of the file ◦ $cat>>file1 ◦ Will append to the content of the file 51 cat
  • 52. Syntax: touch [options] file Options: ◦ a to change the access time ◦ m to change the modification time ◦ c no create if not exists touch is used to change the time stamp of the file Touch <file> will change the time of change of the file is the file exists If the file is not existing it will create a file of zero size 52 touch
  • 53. echo command is used to print an output to the screen echo ―This is an example‖ This is an example x=10 echo $x 10 53 echo
  • 54. more ◦ Allows the user to view one page full of information at a time. file ◦ Used to display the type of the file tty ◦ Prints the terminals name 54 General purpose utilities
  • 55. wc ◦ A filter used to count the number of lines,words and characters in a disk file or in the standard input. ◦ -l - displays the number of lines ◦ -w - displays the number of words ◦ -c - displays the number of characters 55 General purpose utilities
  • 56. cmp ◦ Returns the offset and the line number and the line number of the first position where the two files differs. comm ◦ col1 - unique lines of first file ◦ col2 - unique lines of second file ◦ col3 - common lines 56 General purpose utilities
  • 57. diff ◦ Indicate the differences between the files ◦ a Lines added ◦ d Lines deleted ◦ c Lines changed 57 General purpose utilities
  • 58. find ◦ Used to locate a file or a directory in the given path Usage ◦ find <path> [options] Options ◦ name - accepts the format to searched ◦ print displays the path on the screen 58 General purpose utilities
  • 59. pr ◦ Used to display a file in a format to be printed. ◦ Breaks up a file into pages with a header, text and footer area Options ◦ -l to alter the length of the file ◦ -h to set the header ◦ -t to suppress the header and the footer 59 General purpose utilities
  • 60. Standard Input file ◦ Keyboard , file descriptor is 0 Standard Output file ◦ Monitor , file descriptor is 1 Standard Error file ◦ Monitor, file descriptor is 2 60 Standard files
  • 61. < file redirect standard input from file > file redirect standard output to file 2> file redirect standard error to file 2>&1 merge standard error with standard output $ cat > abc $ ls –l > outfile $ cat xyz abc > outfile 2> errfile $ cat xyz abc > outfile 2>&1 61 I/O redirection
  • 62. Filters are programs that takes its input from the std i/p file, processes it and sends it to the std o/p file. Commonly used filter commands ◦ sort ◦ grep ◦ cut ◦ head ◦ tail ◦ paste 62 Filters
  • 63. Grep -Global Regular Expression Printer Is used for searching regular expressions Syntax ◦ grep <options> <pattern> <filename(s)> 63 grep
  • 64. 64 -c displays count of the number of occurrences -n displays line numbers along with the lines -v displays all lines except lines matching pattern -i Ignores case for matching grep options
  • 65. * - matches 0 or more characters [^pqr] - Matches a single character which is not p ,q or r ^pqr -Matches pqr at the beginning of the line pqr$ -Matches pqr at the end of the file ―.‖ - Matches any one character - ignores the special meaning. ◦ Grep ―New[abc]‖ filename 65 patterns
  • 66. Displays the top n lines of the file Can specify top n lines to be displayed $ head -3 file1 66 Filter command - head
  • 67. Displays the end of the file Can specify last n lines to be displayed $ tail -3 file1 Can also specify the line number from which the data has to be displayed $ tail +5 file1 67 Filter command - tail
  • 68.  Allows the output (only the standard output) of a command to be sent as input to another command.  Multiple pipes may appear in one command line. Example: $ cat * | wc $ cat fil1 | head | wc -l 68 Command piping
  • 69.  tee command allows the normal output to the standard output, as well as to a file  Useful to capture intermediate output of a long command pipeline for further processing or debugging purpose. Example ◦ who | tee userlist 69 Filter command – tee
  • 70. Paste is used to fix two cut portions of the file vertically -s -->Pastes the contents of file2 below file1 -d -->Specify delimiter $ paste -d‖|‖ file1 file2 70 Filter command – paste
  • 71. 71 telnet hostname Allows a connection to host from any other machine connected to the Internet. node itself will prompt for a logon name, then the password. Logging on remotely allows users to use the UNIX/Linux commands, but not the Graphics User Interface of the remote machine. rlogin Bypassing Password - (non-secure) rlogin: rlogin node Allows a connection to node without the use of a password. For this to be true, two things must be properly set. 1.You must have an account (of the same name) on the remote system. 2.File .rhosts on the remote system must contain the name of the local system, followed by your account name. telnet: Connecting to Remote Systems
  • 72. 72 ftp hostname put/send: Transfer to Other hosts put [local_file [remote_file]] get/recv: Transfer From Other hosts get [remote_file [local_file]] mput: Multiple Transfer to Other hosts It will prompt for every file to be transferred, unless the -i flag was used on the ftp command line, or the prompt command is issued. mput is very useful when moving a number of files. FTP
  • 73. 73 gzip, Usage is very similar to compress and pack utilities in unix: gzip [-vc] filename where -v displays the compression ratio. -c sends the compressed output to standard output and leaves the original file intact. Gunzip gunzip can uncompress files originally compressed with compress. Compression utilities
  • 74. 74 tar is a utility that packs a list of files (and/or directories) into a specific tarfile, whose name typically ends in .tar. tar is invoked by tar -c|t|x [vof destination] source... where destination is the name of the tape device or tar file, and source... may be files and/or directories combined to produce the tar file. One of c, t, or x must be used. tar – tape archive
  • 75. 75 -c (create): creates a new tarfile. -t (table): lists the files on the tarfile. -x (extract): extracts the files from the tarfile. -v (verbose): the size and name of each file put onto or extracted from the tarfile is displayed. -o (ownership): on the extraction of files, do NOT extract the original ownership of the files and directories. This avoids the message permission denied when reading tar_files. -f (destination): uses the next argument as the name of the tarfile. It is normally in the form filename.tar (but could also be a device name, such as /dev/8mm). tar – tape archive
  • 76.
  • 77. Process related commands ◦ ps ◦ kill ◦ wait ◦ sleep 77 Processes
  • 78.  Process - a program in execution  When program is executed , a new process is created  The process is alive till the execution of the program is complete  Each process is identified by a number called pid. 78 Processes
  • 79. As soon as the user logs in, a process is created which executes the login shell. Login shell is set for each login in /etc/passwd directory. 79 Login shell
  • 80. The ps command is used to display the characteristics of a process It fetches the pid, tty, time and the command which has started the process. ◦ -f lists the pid of the parent process also. ◦ -u lists the processes of a given user ◦ -a lists the processes of all the users ◦ -e lists all the processes including the system processes 80 ps
  • 81. Enables the user to do more than one task at a time. If the command terminates with a & UNIX executes the command at the background 81 Background process
  • 82. jobs ◦ List the background process fg % ◦ Runs a process in the foreground bg % ◦ Runs a process in the background nice 82 Controlling background processes
  • 83.  kill : Kills or terminates a process  Kill command send a signal to the process ◦ The default signal is 15 ( SIGTERM)  Kill -9 (SIGKILL) ◦ Terminates the process abruptly 83 kill command
  • 84.  Sample entries root:x:0:0:root:/root:/bin/bash xfs:x:43:43:X Font Server:/etc/X11/fs:/bin/false suresh:x:500:500:SURESH:/home/suresh:/bin/bash perumal:x:501:501::/home/perumal:/bin/bash user:x:502:502::/home/user:/bin/bash user1:x:503:503::/home/user1:/bin/bash 84 /etc/passwd file