-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path6
76 lines (57 loc) · 1.06 KB
/
6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
shell
; && ||
echo "" > /root/tmp.txt
echo "" > /root/tmp.txt && echo "went ok"
echo "" > /root/tmp.txt ; echo "went ok"
echo "" > /root/tmp.txt || echo "failed"
processes.
foreground - controlled through a terminal session.
background - process that not connected to a terminal.
-- daemon - special type of the background process that starts at system startup and runs forever - they don't die. (services).
ps -aef aux
pidof
PID, PPID, UID, GID
in shell
echo $$
echo $PPID
effective process id - passwd program example.
chown and chmod - how to get root shell.
process states:
* running
* waiting
* stopped
* zombie
init, process ID 1
fork()
system()
exec()
parent processes, child processes.
in Linux, orphaned process gets adopted by the init.
Stack, Heap, Data, Text.
nohup
&
$ atril
$ atril &
$ jobs
$ nohup atril
screen
ctrl-z
ctrl-c
fg
bg
vim test.c
cc -o test test.c
echo $?
return 0;
process environment, or environment variables.
processes
ps
pstree
wait, kill
signals
nice expensiveprocess
at 10:05
echo "aaa" > /tmp/aaa
^d
watch ls /tmp/
init process