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

Содержание

Журнал

Среда (09/30/15)

/dev/pts/4
09:42:07
#ls -l
итого 56
-rw-r--r-- 1 root root 2646 Сен 29 11:22 all
-rw-r--r-- 1 root root  354 Сен 29 11:21 errors
-rw-r--r-- 1 root root 5268 Окт 13  2014 install
-rw-r--r-- 1 root root 5268 Сен 29 16:22 install.backup
-rw-r--r-- 1 root root 5261 Сен 29 14:00 install.save
-rwxr--r-- 1 root root   41 Сен 29 11:00 privet.sh
-rw-r--r-- 1 root root 5358 Сен 29 11:31 report
-rw-r----- 1 root root 1029 Сен 28 14:24 shadow
-rwxr--r-- 1 root root  245 Сен 29 15:16 shell.sh
-rwxr--r-- 1 root root  145 Сен 29 16:59 wordbook.sh
09:42:14
#chmod u-x privet.sh

09:42:31
#ls -l
итого 56
-rw-r--r-- 1 root root 2646 Сен 29 11:22 all
-rw-r--r-- 1 root root  354 Сен 29 11:21 errors
-rw-r--r-- 1 root root 5268 Окт 13  2014 install
-rw-r--r-- 1 root root 5268 Сен 29 16:22 install.backup
-rw-r--r-- 1 root root 5261 Сен 29 14:00 install.save
-rw-r--r-- 1 root root   41 Сен 29 11:00 privet.sh
-rw-r--r-- 1 root root 5358 Сен 29 11:31 report
-rw-r----- 1 root root 1029 Сен 28 14:24 shadow
-rwxr--r-- 1 root root  245 Сен 29 15:16 shell.sh
-rwxr--r-- 1 root root  145 Сен 29 16:59 wordbook.sh
09:42:37
#test -x privet.sh

09:43:02
#echo $?
1
09:43:05
#test -x shell.sh

09:43:17
#echo $?
0
09:43:18
#[ -x shell.sh ]

09:44:16
#echo $?
0
09:44:17
#help
GNU bash, version 4.2.37(1)-release (x86_64-pc-linux-gnu)
These shell commands are defined internally.  Type `help' to see this list.
Type `help name' to find out more about the function `name'.
Use `info bash' to find out more about the shell in general.
Use `man -k' or `info' to find out more about commands not in this list.
A star (*) next to a name means that the command is disabled.
 job_spec [&]                                             history [-c] [-d offset] [n] or history -anrw [filena>
 (( expression ))                                         if COMMANDS; then COMMANDS; [ elif COMMANDS; then COM>
 . filename [arguments]                                   jobs [-lnprs] [jobspec ...] or jobs -x command [args]>
 :                                                        kill [-s sigspec | -n signum | -sigspec] pid | jobspe>
...
 export [-fn] [name[=value] ...] or export -p             typeset [-aAfFgilrtux] [-p] name[=value] ...
 false                                                    ulimit [-SHacdefilmnpqrstuvx] [limit]
 fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep]>  umask [-p] [-S] [mode]
 fg [job_spec]                                            unalias [-a] name [name ...]
 for NAME [in WORDS ... ] ; do COMMANDS; done             unset [-f] [-v] [name ...]
 for (( exp1; exp2; exp3 )); do COMMANDS; done            until COMMANDS; do COMMANDS; done
 function name { COMMANDS ; } or name () { COMMANDS ; }>  variables - Names and meanings of some shell variable>
 getopts optstring name [arg]                             wait [id]
 hash [-lr] [-p pathname] [-dt] [name ...]                while COMMANDS; do COMMANDS; done
 help [-dms] [pattern ...]                                { COMMANDS ; }
09:47:25
#top
top - 10:48:31 up 4 days, 17:26,  4 users,  load average: 1,00, 1,01, 1,05
Tasks:  80 total,   2 running,  77 sleeping,   1 stopped,   0 zombie
%Cpu(s):  0,0 us,  0,3 sy, 66,7 ni,  0,0 id,  0,0 wa,  0,0 hi,  0,0 si, 33,0 st
KiB Mem:    507368 total,   501532 used,     5836 free,    78164 buffers
KiB Swap:        0 total,        0 used,        0 free,   286356 cached
  PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND
 5748 root      39  19 20628 6372  844 R  99,5  1,3   2613:20 john
  542 root      20   0     0    0    0 S   0,3  0,0   0:00.17 kworker/0:0
  549 root      20   0 71292 3716 2916 S   0,3  0,7   0:00.23 sshd
  845 root      20   0 18168  476  316 S   0,3  0,1   0:00.03 script
...
  867 user      20   0 18164  840  684 S   0,0  0,2   0:00.14 script
  938 user      20   0 18168  480  316 S   0,0  0,1   0:00.00 script
  939 user      20   0 22184 2868 1708 S   0,0  0,6   0:00.09 l3script
 1449 root      20   0 25396 1604 1136 R   0,0  0,3   0:00.03 top
 1908 root      20   0 52772 1632 1200 S   0,0  0,3   0:00.10 rsyslogd
 1945 root      20   0  4116  656  512 S   0,0  0,1   0:00.00 acpid
 1987 root      20   0 22520 1072  828 S   0,0  0,2   0:02.34 cron
 2293 root      20   0 49932 1252  640 S   0,0  0,2   0:00.01 sshd
 2317 root      20   0 18368  968  812 S   0,0  0,2   0:00.13 getty
 2318 root      20   0 18368  972  812 S   0,0  0,2   0:00.00 getty
09:48:40
#wait 549
l3script: wait: pid 549 is not a child of this shell
09:48:52
#top
top - 10:48:56 up 4 days, 17:26,  4 users,  load average: 1,07, 1,03, 1,05
Tasks:  80 total,   3 running,  76 sleeping,   1 stopped,   0 zombie
%Cpu(s):  0,4 us,  0,0 sy, 21,0 ni, 59,3 id,  0,0 wa,  0,0 hi,  0,0 si, 19,3 st
KiB Mem:    507368 total,   500436 used,     6932 free,    78188 buffers
KiB Swap:        0 total,        0 used,        0 free,   285704 cached
  PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND
 5748 root      39  19 20628 6372  844 R  97,3  1,3   2613:43 john
    1 root      20   0 10648  684  568 S   0,0  0,1   0:07.14 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.32 ksoftirqd/0
...
  846 root      20   0 21700 2360 1688 S   0,0  0,5   0:00.29 l3script
  867 user      20   0 18164  840  684 S   0,0  0,2   0:00.14 script
  938 user      20   0 18168  480  316 S   0,0  0,1   0:00.00 script
  939 user      20   0 22184 2868 1708 S   0,0  0,6   0:00.09 l3script
 1464 root      20   0 25424 1544 1096 R   0,0  0,3   0:00.00 top
 1908 root      20   0 52772 1632 1200 S   0,0  0,3   0:00.10 rsyslogd
 1945 root      20   0  4116  656  512 S   0,0  0,1   0:00.00 acpid
 1987 root      20   0 22520 1072  828 S   0,0  0,2   0:02.34 cron
 2293 root      20   0 49932 1252  640 S   0,0  0,2   0:00.01 sshd
 2317 root      20   0 18368  968  812 S   0,0  0,2   0:00.13 getty
09:48:58
#wait 5748
l3script: wait: pid 5748 is not a child of this shell
09:49:04
#kill
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
09:49:20
#kill 5748

09:49:35
#top
top - 10:49:41 up 4 days, 17:27,  4 users,  load average: 0,95, 1,01, 1,04
Tasks:  79 total,   1 running,  77 sleeping,   1 stopped,   0 zombie
%Cpu(s):  0,3 us,  0,3 sy,  0,0 ni, 99,0 id,  0,0 wa,  0,0 hi,  0,0 si,  0,3 st
KiB Mem:    507368 total,   494500 used,    12868 free,    78232 buffers
KiB Swap:        0 total,        0 used,        0 free,   285724 cached
  PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND
 1493 root      20   0 25392 1608 1136 R   0,3  0,3   0:00.01 top
    1 root      20   0 10648  684  568 S   0,0  0,1   0:07.14 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.32 ksoftirqd/0
...
  686 petr      20   0 71292 1760  976 S   0,0  0,3   0:00.00 sshd
  687 petr      20   0 22600 3196 1652 S   0,0  0,6   0:00.17 bash
  768 user      20   0 71292 1764  976 S   0,0  0,3   0:00.00 sshd
  769 user      20   0 22096 2764 1696 S   0,0  0,5   0:00.09 bash
  814 root      20   0 18164  836  684 S   0,0  0,2   0:00.02 script
  845 root      20   0 18168  476  316 S   0,0  0,1   0:00.04 script
  846 root      20   0 21700 2364 1692 S   0,0  0,5   0:00.29 l3script
  867 user      20   0 18164  840  684 S   0,0  0,2   0:00.14 script
  938 user      20   0 18168  480  316 S   0,0  0,1   0:00.00 script
  939 user      20   0 22184 2868 1708 S   0,0  0,6   0:00.09 l3script
09:49:43
#which who
/usr/bin/who
09:49:52
#which cd

09:49:56
#echo $?
1
09:50:01
#which pwd
/bin/pwd
09:50:15
#which kill
/bin/kill
09:50:24
#ls -l /var/spool
итого 12
drwxr-xr-x 3 root        root        4096 Июн 27  2014 cron
drwxr-x--- 5 Debian-exim Debian-exim 4096 Июн 27  2014 exim4
lrwxrwxrwx 1 root        root           7 Июн 27  2014 mail -> ../mail
drwxr-xr-x 2 root        root        4096 Мар  6  2013 rsyslog
09:51:06
#ls -ls /var/spool
итого 12
4 drwxr-xr-x 3 root        root        4096 Июн 27  2014 cron
4 drwxr-x--- 5 Debian-exim Debian-exim 4096 Июн 27  2014 exim4
0 lrwxrwxrwx 1 root        root           7 Июн 27  2014 mail -> ../mail
4 drwxr-xr-x 2 root        root        4096 Мар  6  2013 rsyslog
09:51:16
#ls -ld /var/spool
drwxr-xr-x 5 root root 4096 Июн 27  2014 /var/spool
09:51:20
#ls -ld /var/spool/mail
lrwxrwxrwx 1 root root 7 Июн 27  2014 /var/spool/mail -> ../mail
09:51:30
#ls -ld /var/mail
drwxrwsr-x 2 root mail 4096 Сен 29 12:35 /var/mail
09:51:34
#cd /var/spool/mail

09:52:28
#pwd
/var/spool/mail
09:52:29