Practical Linux - Part 08 - Process & Memory System | 进程与内存系统
- Oct 16 - Process & Memory System
- What is process:
- execute program
- PID
- UID/GID
- example: bash
- parent process & child process
- example
bash <enter> ps -l
- fork & exec system call
- daemon
- Multi-processing
- multiple online user
- multiple processes
-
- Process Control
- foreground & background
<command> &
<command> > /tmp/log.txt 2>&1 &
- stop ctrl + z
jobs
fg [jobid]
bg [jobid]
kill -signal %jobid
killall
nohup <command> &
ps
ps aux
ps -lA
ps axjf
ps -l
top
- load = processes using or waiting for CPU
- PR = priority. PR = NI + 20
- NI = Nice. the higher, the nicer
renice [nice] <PID>
free
- /proc
- uptime
- version
- vmstat
- zoneinfo
lsof
- Assignment
- log on your amazon vm
- make sure your vm has the following to process in the background even you log out:
- a running process running
sleep 1209600 && echo "finally I'm awake. goodbye" > ~/log.txt
- a stopped process running
ping localhost