50%

🚀

4

Linux , , , . , .

Linux ? , , - , , . . , .

Merion Academy


, , - .

, , Linux , , , , , . .


, . , . uptime .

. , bash, {1..6} 1 2 3 4.

for i in 1 2 3 4; do while : ; do : ; done & done	

, , .

$ for i in 1 2 3 4; do while : ; do : ; done & done
[1] 205012
[2] 205013
[3] 205014
[4] 205015

1-4. , .

, , . uptime 30 :

$ while true; do uptime; sleep 30; done	

, :

#!/bin/bash

while true
do
  uptime
  sleep 30
done	

, , .

. 1

1, 5 15 , , .

, kill, - , 1-4, . , jobs, ID.

$ kill %1 %2 %3 %4	

- , , . stress . - - , - , I/O.

--cpu stress , . , .

watch-it (watch-it-2) . , free, .

$ cat watch-it-2
#!/bin/bash

while true
do
  free
  sleep 30
done	

:

$ stress --cpu 2	
. 2

, .

. 3

stress , I/O --io (input/output) --vm (memory).

, watch-it-2:

$ stress --vm 2	
. 4   watch-it-2

- --io, /. :

$ stress --io 4	

I/O iotop. , iotop root.

stress - .


>