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

Содержание

Журнал

Среда (10/17/18)

/dev/pts/0
09:30:24
#ls +([0-9])
ls: cannot access +([0-9]): No such file or directory
09:30:27
#echo $[9+1]
10
09:32:25
#сÑcat install | grep ^step
step()
step "Installing dependencies" apt_get_install_deps
step "Downloading l3bashrc" ${wget} ${url_l3bashrc}
step "Downloading l3prompt" ${wget} ${url_l3prompt}
step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}'
step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }'
step "Installing perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }'
step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users
step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users
step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
прошло >2 часов
11:35:35
#cat install | grep step$

11:35:51
#cat install | grep 'step$'

11:36:23
#шcat > ip.txt
192.168.1.1
8.5.5.1
172.13.18.3
a.b.17.17
87.19.15.16
97.b.4.5
5.7.9.4
8.8.8.8
78.14.16.104
192.14.13.1
182.17.19.5
6.6.6.6
^Z
[1]+  Stopped                 cat > ip.txt
прошло 83 минуты
12:59:34
#сÑcat passwd
cat: passwd: No such file or directory
прошла 31 минута
13:30:34
#cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh
sys:x:3:3:sys:/dev:/bin/sh
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/bin/sh
man:x:6:12:man:/var/cache/man:/bin/sh
lp:x:7:7:lp:/var/spool/lpd:/bin/sh
mail:x:8:8:mail:/var/mail:/bin/sh
news:x:9:9:news:/var/spool/news:/bin/sh
...
list:x:38:38:Mailing List Manager:/var/list:/bin/sh
irc:x:39:39:ircd:/var/run/ircd:/bin/sh
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
libuuid:x:100:101::/var/lib/libuuid:/bin/sh
Debian-exim:x:101:103::/var/spool/exim4:/bin/false
user:x:1000:1000:user,,,:/home/user:/bin/bash
sshd:x:102:65534::/var/run/sshd:/usr/sbin/nologin
ivan:x:1001:1001::/home/ivan:/bin/bash
petr:x:1002:1002::/home/petr:/bin/bash
13:31:05
#cat /etc/passwd | sed '/bash$/p'
root:x:0:0:root:/root:/bin/bash
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh
sys:x:3:3:sys:/dev:/bin/sh
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/bin/sh
man:x:6:12:man:/var/cache/man:/bin/sh
lp:x:7:7:lp:/var/spool/lpd:/bin/sh
mail:x:8:8:mail:/var/mail:/bin/sh
...
nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
libuuid:x:100:101::/var/lib/libuuid:/bin/sh
Debian-exim:x:101:103::/var/spool/exim4:/bin/false
user:x:1000:1000:user,,,:/home/user:/bin/bash
user:x:1000:1000:user,,,:/home/user:/bin/bash
sshd:x:102:65534::/var/run/sshd:/usr/sbin/nologin
ivan:x:1001:1001::/home/ivan:/bin/bash
ivan:x:1001:1001::/home/ivan:/bin/bash
petr:x:1002:1002::/home/petr:/bin/bash
petr:x:1002:1002::/home/petr:/bin/bash
13:32:29
#cat /etc/passwd | sed -n '/bash$/p'
root:x:0:0:root:/root:/bin/bash
user:x:1000:1000:user,,,:/home/user:/bin/bash
ivan:x:1001:1001::/home/ivan:/bin/bash
petr:x:1002:1002::/home/petr:/bin/bash
13:32:49
#cat /etc/passwd | sed 's/bash$/zsh/'
root:x:0:0:root:/root:/bin/zsh
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh
sys:x:3:3:sys:/dev:/bin/sh
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/bin/sh
man:x:6:12:man:/var/cache/man:/bin/sh
lp:x:7:7:lp:/var/spool/lpd:/bin/sh
mail:x:8:8:mail:/var/mail:/bin/sh
news:x:9:9:news:/var/spool/news:/bin/sh
...
list:x:38:38:Mailing List Manager:/var/list:/bin/sh
irc:x:39:39:ircd:/var/run/ircd:/bin/sh
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
libuuid:x:100:101::/var/lib/libuuid:/bin/sh
Debian-exim:x:101:103::/var/spool/exim4:/bin/false
user:x:1000:1000:user,,,:/home/user:/bin/zsh
sshd:x:102:65534::/var/run/sshd:/usr/sbin/nologin
ivan:x:1001:1001::/home/ivan:/bin/zsh
petr:x:1002:1002::/home/petr:/bin/zsh
13:34:57
#cd /etc/cron.d
cron.d/     cron.daily/
13:34:57
#cd /etc/cron.daily/

прошло 85 минут
15:00:03
#vi locate
15:01:11
# 18
 30 # (this is relative to the default which cron sets, which is usually +5)
  2
 31 NICE=10ystems which are pruned from updatedb database
  3
 32 PRUNEFS="NFS nfs nfs4 afs binfmt_misc proc smbfs autofs iso9660 ncpfs coda devpts ftpfs devfs mfs shfs sysfs cifss
  4
 33 # I/O priority
  5
 34 # 1 for real time, 2 for best-effort, 3 for idle ("3" only allowed for root)
  6
...
 51         case "$KVER" in
 52                 2.[012345]*) ;;
 53                 2.6.[0-9]) ;;
 54                 2.6.[0-9].*) ;;
 55                 2.6.1[012]*) ;;
 56                 *)
 57                 # Avoid providing "-n" when IONICE_CLASS isn't 1 or 2
 58                 case "$IONICE_CLASS" in
 59                         1|2) priority="-n ${IONICE_PRIORITY:-7}" ;;
 60                         *) priority="" ;;
15:01:40
# 11
  2
 31 NICE=10ystems which are pruned from updatedb database
  3
 32 PRUNEFS="NFS nfs nfs4 afs binfmt_misc proc smbfs autofs iso9660 ncpfs coda devpts ftpfs devfs mfs shfs sysfs cifss
  4
 33 # I/O priority
  5
 34 # 1 for real time, 2 for best-effort, 3 for idle ("3" only allowed for root)
  6
 35 [ NICE_CLASS=3                   ]
...
 51         case "$KVER" in
 52                 2.[012345]*) ;;
 53                 2.6.[0-9]) ;;
 54                 2.6.[0-9].*) ;;
 55                 2.6.1[012]*) ;;
 56                 *)
 57                 # Avoid providing "-n" when IONICE_CLASS isn't 1 or 2
 58                 case "$IONICE_CLASS" in
 59                         1|2) priority="-n ${IONICE_PRIORITY:-7}" ;;
"locate" 72L, 2209C written
15:01:58
#./locate

15:02:22
#./locate

15:02:43
#./locate

15:02:51
#./locate

15:02:56
#./locate

15:03:03
#locate vimrc
/etc/vim/vimrc
/etc/vim/vimrc.tiny
/root/.lilalo/2642726151522022131-1539672965_1539694231_root_.vimrc.diff
/root/.vimrc
/usr/share/vim/vim73/gvimrc_example.vim
/usr/share/vim/vim73/vimrc_example.vim
/usr/share/vim/vimrc
/usr/share/vim/vimrc.tiny
15:03:22
#find / -mmin -5 -type f 2> /dev/null
/home/user/.lilalo/.report.dat
/root/.lilalo/.report.dat
/root/.lilalo/758327440820527401-1539759888.script
/proc/asound/pcm
/proc/asound/timers
/proc/asound/modules
/proc/asound/cards
/proc/asound/devices
/proc/asound/version
/proc/asound/oss/sndstat
...
/proc/8619/stack
/proc/8619/cpuset
/proc/8619/cgroup
/proc/8619/oom_score
/proc/8619/oom_adj
/proc/8619/oom_score_adj
/proc/8619/loginuid
/proc/8619/sessionid
/proc/8619/coredump_filter
/proc/8619/io
15:08:30
#find / -mmin -5 -type f 2> /dev/null | grep -v proc
/home/user/.lilalo/.report.dat
/root/.lilalo/.report.dat
/root/.lilalo/758327440820527401-1539759888.info
/root/.lilalo/758327440820527401-1539759888.script
15:09:06
#find / -mmin -10 -type f 2> /dev/null | grep -v proc
/etc/cron.daily/locate
/var/cache/locate/locatedb
/var/log/auth.log
/home/user/.lilalo/.report.dat
/root/.lilalo/758327440820527401-1539759888_1539781301_etc_cron.daily_locate.diff
/root/.lilalo/.report.dat
/root/.lilalo/758327440820527401-1539759888_1539781210_etc_cron.daily_locate.diff
/root/.lilalo/758327440820527401-1539759888_1539781272_etc_cron.daily_locate.diff
/root/.lilalo/758327440820527401-1539759888.info
/root/.lilalo/758327440820527401-1539759888.script
/root/.viminfo
15:09:33
#find . -name э'[0-9]*' -type f -maxdepth 1
find: warning: you have specified the -maxdepth option after a non-option argument -name, but options are not positional (-maxdepth affects tests specified before it as well as those specified after it).  Please specify options before other arguments.
15:17:31
#find . -name '[0-9]*' -type f

15:17:34
#cd

15:18:30
#find . -name '[0-9]*' -type f
./.lilalo/2642726151522022131-1539672965_1539682014_etc_resolv.conf.diff
./.lilalo/2219220881169853814-1539756598.info
./.lilalo/2642726151522022131-1539672965.info
./.lilalo/2642726151522022131-1539672965_1539681762_etc_resolv.conf.diff
./.lilalo/758327440820527401-1539759888_1539781301_etc_cron.daily_locate.diff
./.lilalo/2525264871024819419-1403867138.info
./.lilalo/2657892742946813506-1539758624.info
./.lilalo/143184190977814884-1413212456.info
./.lilalo/2657892742946813506-1539758624_1539759766_etc_.bash.bashrc.diff
./.lilalo/2657892742946813506-1539758624.script
...
./.lilalo/2642726151522022131-1539672965_1539694231_root_.vimrc.diff
./.lilalo/23119324163069212524-1403867377.info
./.lilalo/2219220881169853814-1539756598.script
./.lilalo/1901738991017822016-1413212497.script
./.lilalo/2657892742946813506-1539758624_1539759548_root_.bash__profile.diff
./.lilalo/758327440820527401-1539759888.info
./.lilalo/143184190977814884-1413212456.script
./.lilalo/23119324163069212524-1403867377.script
./.lilalo/2657892742946813506-1539758624_1539759773_etc_bash.bashrc.diff
./.lilalo/758327440820527401-1539759888.script
15:18:38
#touch 12345

15:18:48
#find . -name '[0-9]*' -type f -maxdepth 1
find: warning: you have specified the -maxdepth option after a non-option argument -name, but options are not positional (-maxdepth affects tests specified before it as well as those specified after it).  Please specify options before other arguments.
./12345
15:18:50
#find . -name '[0-9]*' -type f -maxdepth 1 -exec mv -v {} /tmp \ ;