Журнал лабораторных работ

Содержание

Журнал

Вторник (09/29/15)

/dev/pts/0
09:42:25
#ls -l $(which chsh)
-rwsr-xr-x 1 root root 41272 Май 26  2012 /usr/bin/chsh
09:43:07
#vi privet.sh
--- /dev/null	2015-09-25 17:23:02.067999996 +0300
+++ privet.sh	2015-09-29 10:53:46.316319809 +0300
@@ -0,0 +1,2 @@
+#!/bin/bash
+echo "Privet ${1}!"
прошло 10 минут
09:53:46
#privet.sh
l3script: privet.sh: команда не найдена
09:53:59
#ls
23423               234235325     file1  file4    privet.sh  wetwet
23423523            234g23        file2  file5    report
234235232252352435  234g23hgfdfh  file3  install  shadow
09:54:22
#echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
09:54:44
#pwd
/root
09:54:47
#/root/privet.sh
l3script: /root/privet.sh: Отказано в доступе
09:55:13
#./privet.sh
l3script: ./privet.sh: Отказано в доступе
09:55:29
#ls -l
итого 16
-rw-r--r-- 1 root root    0 Сен 29 10:26 23423
-rw-r--r-- 1 root root    0 Сен 29 10:26 23423523
-rw-r--r-- 1 root root    0 Сен 29 10:26 234235232252352435
-rw-r--r-- 1 root root    0 Сен 29 10:26 234235325
-rw-r--r-- 1 root root    0 Сен 29 10:26 234g23
-rw-r--r-- 1 root root    0 Сен 29 10:26 234g23hgfdfh
-rw-r--r-- 1 root root    0 Сен 29 10:35 file1
-rw-r--r-- 1 root root    0 Сен 29 10:35 file2
-rw-r--r-- 1 root root    0 Сен 29 10:35 file3
-rw-r--r-- 1 root root    0 Сен 29 10:35 file4
-rw-r--r-- 1 root root    0 Сен 29 10:35 file5
-rw-r--r-- 1 root root 5268 Сен 28 16:43 install
-rw-r--r-- 1 root root   32 Сен 29 10:53 privet.sh
-rw-r--r-- 1 root root    0 Сен 28 14:24 report
-rw-r----- 1 root root 1029 Сен 28 14:23 shadow
-rw-r--r-- 1 root root    0 Сен 29 10:26 wetwet
09:55:39
#chmod u+x privet.sh

09:56:08
#ls -l
итого 16
-rw-r--r-- 1 root root    0 Сен 29 10:26 23423
-rw-r--r-- 1 root root    0 Сен 29 10:26 23423523
-rw-r--r-- 1 root root    0 Сен 29 10:26 234235232252352435
-rw-r--r-- 1 root root    0 Сен 29 10:26 234235325
-rw-r--r-- 1 root root    0 Сен 29 10:26 234g23
-rw-r--r-- 1 root root    0 Сен 29 10:26 234g23hgfdfh
-rw-r--r-- 1 root root    0 Сен 29 10:35 file1
-rw-r--r-- 1 root root    0 Сен 29 10:35 file2
-rw-r--r-- 1 root root    0 Сен 29 10:35 file3
-rw-r--r-- 1 root root    0 Сен 29 10:35 file4
-rw-r--r-- 1 root root    0 Сен 29 10:35 file5
-rw-r--r-- 1 root root 5268 Сен 28 16:43 install
-rwxr--r-- 1 root root   32 Сен 29 10:53 privet.sh
-rw-r--r-- 1 root root    0 Сен 28 14:24 report
-rw-r----- 1 root root 1029 Сен 28 14:23 shadow
-rw-r--r-- 1 root root    0 Сен 29 10:26 wetwet
09:56:16
#ls -l --color
итого 16
-rw-r--r-- 1 root root    0 Сен 29 10:26 23423
-rw-r--r-- 1 root root    0 Сен 29 10:26 23423523
-rw-r--r-- 1 root root    0 Сен 29 10:26 234235232252352435
-rw-r--r-- 1 root root    0 Сен 29 10:26 234235325
-rw-r--r-- 1 root root    0 Сен 29 10:26 234g23
-rw-r--r-- 1 root root    0 Сен 29 10:26 234g23hgfdfh
-rw-r--r-- 1 root root    0 Сен 29 10:35 file1
-rw-r--r-- 1 root root    0 Сен 29 10:35 file2
-rw-r--r-- 1 root root    0 Сен 29 10:35 file3
-rw-r--r-- 1 root root    0 Сен 29 10:35 file4
-rw-r--r-- 1 root root    0 Сен 29 10:35 file5
-rw-r--r-- 1 root root 5268 Сен 28 16:43 install
-rwxr--r-- 1 root root   32 Сен 29 10:53 privet.sh
-rw-r--r-- 1 root root    0 Сен 28 14:24 report
-rw-r----- 1 root root 1029 Сен 28 14:23 shadow
-rw-r--r-- 1 root root    0 Сен 29 10:26 wetwet
09:56:50
#./privet.sh Andrey
Privet Andrey!
09:58:23
#vi privet.sh
09:58:26
#~
Privet Noname!
09:58:28
#./privet.sh Andrey
Privet Andrey!
09:58:33
#vi privet.sh
--- /tmp/l3-saved-7671.2617.20523	2015-09-29 10:58:53.944319807 +0300
+++ privet.sh	2015-09-29 10:59:54.232319809 +0300
@@ -1,2 +1,2 @@
 #!/bin/bash
-echo "Privet ${1:-Noname}!"
+echo "Privet ${1:+Noname}!"
09:59:54
#./privet.sh Andrey
Privet Noname!
09:59:56
#./privet.sh
Privet !
10:00:01
#echo $((7+5))
12
10:00:59
#echo $[7+5]
12
10:01:31
#i=1

10:02:30
#echo $i
1
10:02:45
#i=$[$i+1]

10:03:11
#echo $i
2
10:03:29
#i=$[56/9]

10:04:17
#echo $[56/9]
6
10:04:22
#top
top - 11:05:09 up 3 days, 17:42,  3 users,  load average: 1,01, 1,03, 1,05
Tasks:  57 total,   2 running,  55 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0,0 us,  0,0 sy, 52,7 ni,  0,0 id,  0,0 wa,  0,0 hi,  0,0 si, 47,3 st
KiB Mem:    507368 total,   307792 used,   199576 free,    89936 buffers
KiB Swap:        0 total,        0 used,        0 free,   116672 cached
  PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND
 5939 root      39  19 20608 6360  856 R  99,7  1,3   1086:48 john
 7371 root      20   0     0    0    0 S   0,3  0,0   0:00.81 kworker/0:0
 7393 root      20   0 71292 3724 2904 S   0,3  0,7   0:00.99 sshd
    1 root      20   0 10648  832  696 S   0,0  0,2   0:04.72 init
...
    8 root       0 -20     0    0    0 S   0,0  0,0   0:00.00 cpuset
    9 root       0 -20     0    0    0 S   0,0  0,0   0:00.00 khelper
   10 root      20   0     0    0    0 S   0,0  0,0   0:00.00 kdevtmpfs
   11 root       0 -20     0    0    0 S   0,0  0,0   0:00.00 netns
   12 root      20   0     0    0    0 S   0,0  0,0   0:00.00 xenwatch
   13 root      20   0     0    0    0 S   0,0  0,0   0:00.00 xenbus
   14 root      20   0     0    0    0 S   0,0  0,0   0:01.14 sync_supers
   15 root      20   0     0    0    0 S   0,0  0,0   0:00.02 bdi-default
   16 root       0 -20     0    0    0 S   0,0  0,0   0:00.00 kintegrityd
   17 root       0 -20     0    0    0 S   0,0  0,0   0:00.00 kblockd
10:05:18
#ps ax
  PID TTY      STAT   TIME COMMAND
    1 ?        Ss     0:04 init [2]
    2 ?        S      0:00 [kthreadd]
    3 ?        S      0:00 [ksoftirqd/0]
    5 ?        S      0:00 [kworker/u:0]
    6 ?        S      0:00 [migration/0]
    7 ?        S      0:02 [watchdog/0]
    8 ?        S<     0:00 [cpuset]
    9 ?        S<     0:00 [khelper]
   10 ?        S      0:00 [kdevtmpfs]
...
 7471 ?        Ss     0:00 sshd: ivan [priv]
 7473 ?        S      0:00 sshd: ivan@pts/2
 7474 pts/2    Ss+    0:00 -bash
 7555 ?        Ss     0:00 sshd: petr [priv]
 7557 ?        S      0:00 sshd: petr@pts/3
 7558 pts/3    Ss+    0:00 -bash
 7639 pts/0    S+     0:00 script -f -c l3script -q /root/.lilalo//3214919816900
 7670 pts/0    S+     0:00 script -f -c l3script -q /root/.lilalo//3214919816900
 7671 pts/4    Ss     0:00 l3script
 8624 pts/4    R+     0:00 ps ax
10:05:33
#ps ax | wc -l
59
10:06:02
#top
top - 11:06:28 up 3 days, 17:43,  3 users,  load average: 1,03, 1,04, 1,05
Tasks:  57 total,   2 running,  55 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0,2 us,  0,0 sy, 13,1 ni, 75,2 id,  0,1 wa,  0,0 hi,  0,0 si, 11,4 st
KiB Mem:    507368 total,   308040 used,   199328 free,    89996 buffers
KiB Swap:        0 total,        0 used,        0 free,   116728 cached
  PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND
 5939 root      39  19 20608 6360  856 R  99,0  1,3   1088:06 john
    1 root      20   0 10648  832  696 S   0,0  0,2   0:04.72 init
    2 root      20   0     0    0    0 S   0,0  0,0   0:00.00 kthreadd
    3 root      20   0     0    0    0 S   0,0  0,0   0:00.23 ksoftirqd/0
...
    8 root       0 -20     0    0    0 S   0,0  0,0   0:00.00 cpuset
    9 root       0 -20     0    0    0 S   0,0  0,0   0:00.00 khelper
   10 root      20   0     0    0    0 S   0,0  0,0   0:00.00 kdevtmpfs
   11 root       0 -20     0    0    0 S   0,0  0,0   0:00.00 netns
   12 root      20   0     0    0    0 S   0,0  0,0   0:00.00 xenwatch
   13 root      20   0     0    0    0 S   0,0  0,0   0:00.00 xenbus
   14 root      20   0     0    0    0 S   0,0  0,0   0:01.14 sync_supers
   15 root      20   0     0    0    0 S   0,0  0,0   0:00.02 bdi-default
   16 root       0 -20     0    0    0 S   0,0  0,0   0:00.00 kintegrityd
   17 root       0 -20     0    0    0 S   0,0  0,0   0:00.00 kblockd