Академический Документы
Профессиональный Документы
Культура Документы
I
P
L
i
t
er
io
t
a
c
fi
a
x
k
u
b
.
n
ww
Li
w
//
:
tp
t
h
d
a
c
.c o
Objectives
Work on the Command Line
I
P
L
//
:
tp
t
h
i f com
t
r d.
e
a
C
PS1
c
a
x
kcommand prompt
u
b
o This special variable holds the contents
of
the
.
n
w
i
that are displayed when bash is ready
to w
accept commands
L
I
/w
/
:
o Display the contents of PS1: P
L http
I
P
L
x bk
u
.
n
w
i
w
L
w
//
:
tp
t
h
a
c
a
r
e
C
I
P
L
x bk
u
.
n
w
i
w
L
w
//
:
tp
t
h
a
c
a
c
.
d
I
P
L
i
t
er
n
o
i
t
a
c
fi
a
x
k
u
b
.
n
ww
Li
w
//
:
tp
t
h
d
a
c
.c o
i f com
t
r d.
e
a
C
Command substitution
c
This feature allows you to replace the result
of a command
with a
a
x
k
script
.b
nu
w
i
w
L
I
/w
/
:
L P t tp
h
Man pages
Although the books were convenient, many users didnt always
want to dig through printed documentation or carry it around
n on the
o
The man (manual) command was created to put the books
i
t
a
system, giving users immediate access to the information
they
c
i
i f com
needed
t
r d.
e
There is a manpage for most commands on your
a
C system
I
P
L
c
a
x
k
u
b
.
n
i
ww
L
w
//
:
tp
t
h
I
P
L
i
t
er
n
o
i
t
a
c
fi
a
x
k
u
b
.
n
ww
Li
w
//
:
tp
t
h
d
a
c
.c o
Cut command:
i
t
er
n
o
i
t
a
c
fi
d
.c o
a one or more
Cut out (that is, print) selected columns or fields
C from
c
a
x
k
files
u
b
.
n
w
i
The source file is not changed
w
L
I
/w
/
:
LP http
I
P
L
i
t
er
io
t
a
c
fi
a
x
k
u
b
.
n
ww
Li
w
//
:
tp
t
h
d
a
c
.c o
I
P
L
i
t
er
n
o
i
t
a
c
fi
a
x
k
u
b
.
n
ww
Li
w
//
:
tp
t
h
d
a
c
.c o
I
P
L
i
t
er
n
o
i
t
a
c
fi
a
x
k
u
b
.
n
ww
Li
w
//
:
tp
t
h
d
a
c
.c o
I
P
L
i
t
er
n
o
i
t
a
c
fi
a
x
k
u
b
.
n
ww
Li
w
//
:
tp
t
h
d
a
c
.c o
I
P
L
i
t
er
n
o
i
t
a
c
fi
a
x
k
u
b
.
n
ww
Li
w
//
:
tp
t
h
d
a
c
.c o
I
P
L
i
t
er
n
o
i
t
a
c
fi
a
x
k
u
b
.
n
ww
Li
w
//
:
tp
t
h
d
a
c
.c o
I
P
L
i
t
er
n
o
i
t
a
c
fi
a
x
k
u
b
.
n
ww
Li
w
//
:
tp
t
h
d
a
c
.c o
I
P
L
i
t
er
io
t
a
c
fi
a
x
k
u
b
.
n
ww
Li
w
//
:
tp
t
h
d
a
c
.c o
I
P
L
i
t
er
n
o
i
t
a
c
fi
a
x
k
u
b
.
n
ww
Li
w
//
:
tp
t
h
d
a
c
.c o
I
P
L
i
t
er
n
o
i
t
a
c
fi
a
x
k
u
b
.
n
ww
Li
w
//
:
tp
t
h
d
a
c
.c o
I
P
L
i
t
er
n
o
i
t
a
c
fi
a
x
k
u
b
.
n
ww
Li
w
//
:
tp
t
h
d
a
c
.c o
I
P
L
i
t
er
n
o
i
t
a
c
fi
a
x
k
u
b
.
n
ww
Li
w
//
:
tp
t
h
d
a
c
.c o
I
P
L
i
t
er
n
o
i
t
a
c
fi
a
x
k
u
b
.
n
ww
Li
w
//
:
tp
t
h
d
a
c
.c o
I
P
L
i
t
er
n
o
i
t
a
c
fi
a
x
k
u
b
.
n
ww
Li
w
//
:
tp
t
h
d
a
c
.c o
uniq command:
Writes input (or stdin) to output (or stdout), eliminating duplicate
lines.
I
P
L
i
t
er
n
o
i
t
a
c
fi
a
x
k
u
b
.
n
ww
Li
w
//
:
tp
t
h
d
a
c
.c o
wc command:
Print counts of characters, words, and lines for files
I
P
L
i
t
er
n
o
i
t
a
c
fi
a
x
k
u
b
.
n
ww
Li
w
//
:
tp
t
h
d
a
c
.c o
I
P
L
x bk
u
.
n
w
i
w
L
w
//
:
tp
t
h
a
c
a
bzip2
cp
cpio
dd
file
find
gzip and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tp
t
h
d
a
c
.c o
I
P
L
i
t
er
n
o
i
t
a
c
fi
a
x
k
u
b
.
n
ww
Li
w
//
:
tp
t
h
d
a
c
.c o
I
P
L
i
t
er
n
o
i
t
a
c
fi
a
x
k
u
b
.
n
ww
Li
w
//
:
tp
t
h
d
a
c
.c o
I
P
L
i
t
er
n
o
i
t
a
c
fi
a
x
k
u
b
.
n
ww
Li
w
//
:
tp
t
h
d
a
c
.c o
I
P
L
//
:
tp
t
h
i
t
er
n
o
i
t
a
c
fi
d
a
c
.c o
a
x
k
u
bprovided with three
.
n
When a program is launched, it is automatically
w
i
w
L
file descriptors
I
/w
/
:
LP http
Pipes
From a programs point of
view there is no difference
between reading text data
from a file and reading it from
your keyboard.
Similarly, writing text to a file
and writing text to a display
are equivalent operation
As an extension of this idea, it
is also possible to tie the
output of one program to the
input of another that called
pipes (|)
Redirection
Each pipe symbol in the
previous pipeline example
instructs the shell to feed
output from one command
into the input of another.
This action is a special form
of redirection, which allows
you to manage the origin of
input streams and the
destination of output
streams.
Process
The management and control of processes is also essential for
smooth system operation
nscript, that
o
Every program, whether its a command, application, or
i
t
a
runs on your system is a process
c
i
f
mfrom the
i
Your shell is a process, and every command yout execute
o
c
r d.
e
shell starts one or more processes of its ownC(referred
a to as child
c
x
processes).
ka
I
P
L
u
b
.
n
Li www
//
:
tp
t
h
I
P
L
c
i
f
m
i
o
t
c
e r d.
x bk
u
.
n
w
i
w
L
w
//
:
tp
t
h
a
c
a
I
P
L
i
t
er
n
o
i
t
a
c
fi
a
x
k
u
b
.
n
ww
Li
w
//
:
tp
t
h
d
a
c
.c o
I
P
L
i
t
er
n
o
i
t
a
c
fi
a
x
k
u
b
.
n
ww
Li
w
//
:
tp
t
h
d
a
c
.c o
I
P
L
i
t
er
n
o
i
t
a
c
fi
a
x
k
u
b
.
n
ww
Li
w
//
:
tp
t
h
d
a
c
.c o
i
t
er
a
c
fi
d
a
c
.c o
a
x
k
b
.
o Load average on a Linux system is nu
w
i
w
L
defined as the number of blocking processes
in the run queue
w
I
/
:/
averaged over a certain time period.
P
p
tt
L
I
P
L
c
a
x
k
u
b
.
n
i
ww
L
w
//
:
tp
t
h
I
P
L
i
t
er
n
o
i
t
a
c
fi
a
x
k
u
b
.
n
ww
Li
w
//
:
tp
t
h
d
a
c
.c o
I
P
L
i
t
er
io
t
a
c
fi
a
x
k
u
b
.
n
ww
Li
w
//
:
tp
t
h
d
a
c
.c o
I
P
L
//
:
tp
t
h
I
P
L
//
:
tp
t
h
I
P
L
n
i
L
b
.
w
w
//w
:
tt p
The nice command works to change theh nice number for new
processes only at the time that theyre started. To modify a
running program, use the renice command.
Renice
Alter the nicenumber to set the scheduling priority of one or more
running target processes
nPIDs.
o
By default, renice assumes that the targets are numeric
ti
I
P
L
i
t
er
a
c
fi
a
x
k
u
b
.
n
ww
Li
w
//
:
tp
t
h
d
a
c
.c o
I
P
L
i
t
er
n
o
i
t
a
c
fi
a
x
k
u
b
.
n
ww
Li
w
//
:
tp
t
h
d
a
c
.c o
I
P
L
i
t
er
n
o
i
t
a
c
fi
a
x
k
u
b
.
n
ww
Li
w
//
:
tp
t
h
d
a
c
.c o
I
P
L
i
t
er
n
o
i
t
a
c
fi
a
x
k
u
b
.
n
ww
Li
w
//
:
tp
t
h
d
a
c
.c o
I
P
L
i
t
er
n
o
i
t
a
c
fi
a
x
k
u
b
.
n
ww
Li
w
//
:
tp
t
h
d
a
c
.c o
n
o
i to
Search files or standard input for lines containing a match
t
a
c
regular expression regex
i
f
m
i
o
t
For example, to find all lines in file1 that contain
either
Linux
or
c
r d.
e
linux, you could use grep like this:
C aca
x bk
u
.
n
w
i
w
L
w
I
//
:
P
L http
I
P
L
i
t
er
n
o
i
t
a
c
fi
a
x
k
u
b
.
n
ww
Li
w
//
:
tp
t
h
d
a
c
.c o
I
P
L
i
t
er
n
o
i
t
a
c
fi
a
x
k
u
b
.
n
ww
Li
w
//
:
tp
t
h
d
a
c
.c o
I
P
L
i
t
er
n
o
i
t
a
c
fi
a
x
k
u
b
.
n
ww
Li
w
//
:
tp
t
h
d
a
c
.c o
vi Basics
The vi editor has two modes of operation: command or insert
In command mode, vi allows you to navigate around your file and
n
o
enter commands
i
t
a
To enter new text,put vi into insert mode
c
i
f
i
om
t i .key
To switch from command to insert mode, pressrthe
c
e
d
a
To terminate insert mode, press the Escape C
key (Esc),
c which puts
a
you back in command mode
ux .bk
I
P
L
n
i
L
:
tt p
h
w
w
//w
I
P
L
<full key command: page 142>
i
t
er
n
o
i
t
a
c
fi
a
x
k
u
b
.
n
ww
Li
w
//
:
tp
t
h
d
a
c
.c o