1.
|
echo
$USER |ENTER|
|
root
|
2.
|
ps
|ENTER|
|
PID
TTY TIME CMD
47 hvc0 00:00:00 sh
100 hvc0 00:00:00 ps
|
3.
|
ps
|ENTER|
|
PID
TTY TIME CMD
47 hvc0 00:00:00 sh
101 hvc0 00:00:00 ps
|
4.
|
echo
ps > /dev/hvc0 |ENTER|
|
ps
|
5.
|
yes
"I am you, and you are me, and we are all, together"
|ENTER|
|
I
am me, and me are you, and we are all together
I am me, and
me are you, and we are all together
I am me, and me are
you, and we are all together
I am me, and me are you, and
we are all together
I am me, and me are you, and we are all
together
...
I
am me, and me are you, and we are all together
I am me, and
me are you, and we are all^C
|
6.
|
|CTRL|
|Z|
|
I
am me, and me are^Z
[1]+ Stopped(SIGTSTP) yes "I am
me, and me are you, and we are all together"
|
7.
|
ps
|ENTER|
kill
-s TERM %1 |ENTER|
jobs
|ENTER|
|
PID
TTY TIME CMD
47 hvc0 00:00:00 sh
101 hvc0 00:00:04
yes
102 hvc0 00:00:00 ps
[1]+
Terminated yes "I am...
|
8.
|
yes
"together no more" > /dev/null |ENTER|
|
|
9.
|
|CTRL||Z|
bg
%1
|ENTER|
ps
-l |ENTER|
|
^Z
[1]+ Stopped(SIGTSTP) yes "together no more" >
/dev/null
[1] yes "together no more" >
/dev/null &
F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY
TIME CMD
0 S 0 47 1 0 80 0 - 1522 sinitt hvc0 00:00:00 sh
0
T 0 274 47 67 80 0 - 1136 do_sig hvc0 00:05:22 yes
0 R 0
279 47 0 80 0 - 2108 - hvc0 00:00:00 ps
|
10.
|
??????????
|ENTER|
|ENTER|
|
[1]+
Terminated yes "together no more" > /dev/nul
|
11.
|
bash
|ENTER|
ps
|ENTER|
|
PID
TTY TIME CMD
47 hvc0 00:00:01 sh
300 hvc0 00:00:00
bash
319 hvc0 00:00:00 ps
|
12.
|
yes
"hi" > /dev/null 2>&1 |ENTER|
|CTRL||Z|
bg
%1 |ENTER|
ps
|ENTER|
|
^Z
[1]+ Stopped yes "hi" > /dev/null 2>&1
[1]+
yes "hi" > /dev/null 2>&1 &
PID
TTY TIME CMD
47 hvc0 00:00:01 sh
300 hvc0 00:00:00
bash
402 hvc0 00:03:23 yes
403 hvc0 00:00:00 ps
|
13.
|
exit
|ENTER|
ps
|ENTER|
jobs
|ENTER|
kill
-s TERM %1 |ENTER|
ps
|ENTER|
kill
-s TERM 402 |ENTER|
ps
|ENTER|
|
PID
TTY TIME CMD
47 hvc0 00:00:01 sh
402 hvc0 00:03:23
yes
404
hvc0
00:00:00 ps
sh:
kill: %1: no such job
PID
TTY TIME CMD
47 hvc0 00:00:01 sh
402 hvc0 00:03:23
yes
404
hvc0
00:00:00 ps
PID
TTY TIME CMD
47 hvc0 00:00:01 sh
406
hvc0
00:00:00 ps
|
14.
|
ls
-sh hello.c
ls
-sh juan
ls
-hs hello.c > ls.log
cat
ls.log
ls
-hs juan > ls.log
cat
ls.log
ls
-hs juan > log.log 2>&1
cat
ls.log
|
4.0K
hello.c
ls:
cannot access 'juan': No such file or directory
4.0K
hello.c
ls:
cannot access 'juan': No such file or directory
ls:
cannot access 'juan': No such file or directory
|
|
cat
ls.log
|
Enter your answers:
|
|
ls
-sh hello.c
|
|
|
ls
-sh juan
|
|
15.
|
ls
-hs hello.c > ls.log
|
|
|
cat
ls.log
|
|
|
ls
-hs juan > ls.log
|
|
|
cat
ls.log
|
|
|
ls
-hs juan > log.log 2>&1
|
|
16.
|
top
|ENTER|
|
top - 19:27:56 up 6:21, 0
users, load average: 0.06, 0.02, 0.00
Tasks: 21 total, 1
running, 20 sleeping, 0 stopped, 0 zombie
%Cpu(s):0.7 us,
0.7 sy, 0.0 ni, 98.7 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0st
MiB
Mem : 246.1 total, 237.0 free, 5.6 used, 3.5 buff/cache
MiB
Swap: 0.0 total, 0.0 free, 0.0 used. 235.8 avail Mem
PID
USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1574
root 20 0 8848 2320 1740 R 2.0 0.9 0:00.69 top
1 root 20 0
2896 1424 1164 S 0.0 0.6 0:00.75 init
2 root 20 0 0 0 0 S
0.0 0.0 0:00.00 kthreadd
3 root 20 0 0 0 0 I 0.0 0.0
0:00.00 kworker/0+
4 root 0 -20 0 0 0 I 0.0 0.0 0:00.00
kworker/0+
5 root 20 0 0 0 0 I 0.0 0.0 0:00.00 kworker/u+
6
root 0 -20 0 0 0 I 0.0 0.0 0:00.00 mm_percpu+
7 root 20 0 0
0 0 S 0.0 0.0 0:01.84 ksoftirqd+
8 root 20 0 0 0 0 S 0.0
0.0 0:00.07 kdevtmpfs
9 root 0 -20 0 0 0 I 0.0 0.0 0:00.00
netns
10 root 20 0 0 0 0 S 0.0 0.0 0:00.00 oom_reaper
11
root 0 -20 0 0 0 I 0.0 0.0 0:00.00 writeback
12 root 0 -20
0 0 0 I 0.0 0.0 0:00.00 crypto
13 root 0 -20 0 0 0 I 0.0
0.0 0:00.00 kblockd
14 root 20 0 0 0 0 S 0.0 0.0 0:00.00
kswapd0
15 root 20 0 0 0 0 I 0.0 0.0 0:00.14 kworker/0+
32
root 20 0 0 0 0 S 0.0 0.0 0:00.00 khvcd
42 root 20 0 1948
1064 788 S 0.0 0.4 0:00.42 dhcpcd
47 root 20 0 6088 2224
1708 S 0.0 0.9 0:01.90 sh
78 root 20 0 0 0 0 I 0.0 0.0
0:00.20 kworker/u+
488 root 20 0 6060 2396 1808 S 0.0 1.0
0:01.87 bash
|
|
|
|