nice . " nice", -20 ( ), 19 ( ). 10. nice . , . :
nice -n <>
. , - nice, 10 nice .
, renice: renice n <> - pPID
renice priority [[-p] PID] [[-g] grp] [[-u] user]
,
[root]# renice -1 987 -u daemon -p 32 - 1 PID 987 32, daemon.
. , . ( nice), , nice , . " ".
:
1) ps?
2) top?
3) top?
4) ?
5) nice renice?
:
1. . . . 4- . 2015
2. . . Linux 4- - 2012
22. UNIX.
:
1. Linux
2.
3.
Linux
Linux Windows, .
Windows Linux , .. .
(user ID, UID). , group ID, GID.
: (user owner) (group owner). , :
|
|
1. - (owner).
2. - (group).
3. (others).
: (x) - , (r) - , (w) - () . .. , 3 . , . 1 , 0 , .. , , , .
. , .
. - .
. .
. SUID SGID.
SUID. SUID , , , . , , . , , passwd, , root, SUID, shadow, root.
SGID. SGID, SUID, , . SGID , , , .
. , . , SUID , . , root. , .
:
1. Linux?
2. ?
|
|
3. ?
:
1. . . . . 2009
2. . . Linux 4- - 2012
23. Linux.
:
4.
5.
6.
Linux , . , , , (, ). Linux , . 3 :
- (r), (w), (x) ;
- , , ;
- , , .
:
rwxrwxrwx ,
rwxr-xr-x , - .
rw-rw-r-- , .
, .
. :
r , ls.
w , . . . .
, cd.
, , .
Linux . chmod, chown chgrp.
chmod (ChangeMODe ) . root. :
chmodmodefilename,
filename , ;
mode , . 2 .
chmod :
|r|
|u| |w|
|g| |+| |x|
chmod |o| |-| |X| filename,
|a| |=| |u|
|g|
|o|
:
u,g,o,a , , , .
+,-,= , , .
r,w,x,X,u,g,o , , , , , , .
filename - , .
[student@ns student]$ ls -l lesson5.txt
-rw------- 1 student student 39 Nov 19 15:17 lesson5.txt
[student@ns student]$ chmod g+rw lesson5.txt
[student@ns student]$ ls -l lesson5.txt
-rw-rw---- 1 student student 39 Nov 19 15:18 lesson5.txt
[student@ns student]$ chmod o=u lesson5.txt
[student@ns student]$ ls -l lesson5.txt
-rw-rw-rw- 1 student student 39 Nov 19 15:18 lesson5.txt
[student@ns student]$ chmod o-w lesson5.txt
[student@ns student]$ ls -l lesson5.txt
|
|
-rw-rw-r-- 1 student student 39 Nov 19 15:19 lesson5.txt
[student@nsstudent]$_
3- . :
rwxr-xr-- :
111 101 100
8- :
111 7, 101 5, 100 4.
:
000 | 0 | 100 | 4 |
001 | 1 | 101 | 5 |
010 | 2 | 110 | 6 |
011 | 3 | 111 | 7 |
:
[student@ns student]$ ls -l lesson5.txt
-rw-rw-r-- 1 student student 39 Nov 19 15:19 lesson5.txt
[student@ns student]$chmod 755 lesson5.txt
[student@ns student]$ ls -l lesson5.txt
-rwxr-xr-- 1 student student 39 Nov 19 15:19 lesson5.txt
: lesson5.txt : rwxr- - r - - (744), r - - - w- - - x(421), - - x - w - r - -(124).
.
chown (CHangeOWNer ) . root. :
chownusername:groupnamefilename,
username ;
groupname ;
filename , .
, .
chgrp - . :
chgrpgroupnamefilename,
:
groupname ,
filename
, chown chmod - root, chgrp - - , - root.
:
1) ?
2) ?
3) - ?
4) ?
:
1. . . . 4- . 2015
2. . . Linux 4- - 2012
24. Linux.
:
1. -
2.
3. grep
Linux . . vi emacs.
-
, ( ), . , (standard input - 0), , (standard output - 1), , (standard error - 2). , , ( ) . Linux- . ,
sort
sort, ( Ctrl+D, ), .
|
|
, . < > . .
. :
> - ( ). , , ( )
>> - . , , .
< - ( )
&>
2>
,
sort <in >out
sort in out. , . , , , .
, :
sort <in >temp; head 30 <temp; rm temp
sort, in temp. , head, 30 temp , . , temp . .
, , . temp. Linux .
sort <in | head 30
, ( , ( ), , sort head, , . , , (pipeline) .
$ catfile | tail -n 3 | less
, :
- cat file tail
- tail 3 less
- less .
.
, , . . , , .
.
^ -
$ -
[] - . , [0-9] , [a-zA-Z] -
[^] -
\ - . \$ - $, \ , \\$ - \ .
. - .
* - 0 .
.* .
Linux. grep. . Ÿ .
grep
grep, fgrep, egrep | , , |
grep
|
|
Ls - l | greprwxrwxrwx
greprwxrwxrwx ls -l . , . .
grep , :
Du | grep ' mp 3' | more
mp3 .
( du (), .)