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

Содержание

Журнал

Среда (06/07/17)

/dev/pts/0
15:11:33
#cat install | tr '-' ' '
#!/bin/sh
hostname=`hostname`
uname  a | egrep  qi '(freebsd|darwin)' || hostname=`hostname  f`
###############################################################################
#
# Set this variables before installation:
lilalo_user=13 10 2014
lab=NT LNet
install_l3bashrc_for_this_users=${users: "root user"}  # users who will use l3agent and l3script
lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
...
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
cd /
rm  rf ${temp_dir}
show_final_message
15:11:45
#cat install | tr '-' ' '
#!/bin/sh
hostname=`hostname`
uname  a | egrep  qi '(freebsd|darwin)' || hostname=`hostname  f`
###############################################################################
#
# Set this variables before installation:
lilalo_user=13 10 2014
lab=NT LNet
install_l3bashrc_for_this_users=${users: "root user"}  # users who will use l3agent and l3script
lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
...
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
cd /
rm  rf ${temp_dir}
show_final_message
15:11:46
#cat install | tr '-' ' '
#!/bin/sh
hostname=`hostname`
uname  a | egrep  qi '(freebsd|darwin)' || hostname=`hostname  f`
###############################################################################
#
# Set this variables before installation:
lilalo_user=13 10 2014
lab=NT LNet
install_l3bashrc_for_this_users=${users: "root user"}  # users who will use l3agent and l3script
lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
...
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
cd /
rm  rf ${temp_dir}
show_final_message
15:11:47
#cat install | tr '-' ' '
#!/bin/sh
hostname=`hostname`
uname  a | egrep  qi '(freebsd|darwin)' || hostname=`hostname  f`
###############################################################################
#
# Set this variables before installation:
lilalo_user=13 10 2014
lab=NT LNet
install_l3bashrc_for_this_users=${users: "root user"}  # users who will use l3agent and l3script
lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
...
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
cd /
rm  rf ${temp_dir}
show_final_message
15:11:47
#cat install | tr '-' ' '
#!/bin/sh
hostname=`hostname`
uname  a | egrep  qi '(freebsd|darwin)' || hostname=`hostname  f`
###############################################################################
#
# Set this variables before installation:
lilalo_user=13 10 2014
lab=NT LNet
install_l3bashrc_for_this_users=${users: "root user"}  # users who will use l3agent and l3script
lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
...
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
cd /
rm  rf ${temp_dir}
show_final_message
15:11:48
#cat install | tr '_' ' '
#!/bin/sh
hostname=`hostname`
uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f`
###############################################################################
#
# Set this variables before installation:
lilalo user=13-10-2014
lab=NT-LNet
install l3bashrc for this users=${users:-"root user"}  # users who will use l3agent and l3script
lilalo context="/users/${lilalo user}/${lab}/${hostname}"
...
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
cd /
rm -rf ${temp dir}
show final message
15:11:56
#cat install | tr '_' ' '
#!/bin/sh
hostname=`hostname`
uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f`
###############################################################################
#
# Set this variables before installation:
lilalo user=13-10-2014
lab=NT-LNet
install l3bashrc for this users=${users:-"root user"}  # users who will use l3agent and l3script
lilalo context="/users/${lilalo user}/${lab}/${hostname}"
...
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
cd /
rm -rf ${temp dir}
show final message
15:11:57
#cat install | tr '_' ' ' > install.new

15:20:34
#cat install.new | tr '-' ' ' > install.new

15:20:48
#cat install.new
#!/bin/sh
hostname=`hostname`
uname  a | egrep  qi '(freebsd|darwin)' || hostname=`hostname  f`
###############################################################################
#
# Set this variables before installation:
lilalo user=13 10 2014
lab=NT LNet
install l3bashrc for this users=${users: "root user"}  # users who will use l3agent and l3script
lilalo context="/users/${lilalo user}/${lab}/${hostname}"
...
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
cd /
rm  rf ${temp dir}
show final message
15:21:00
#cat install.new | tr '"' ' ' > install.new

15:21:15
#cat install.new | tr '~' ' ' > install.new

15:21:22
#cat install.new | tr ' ' ' ' > install.new

15:21:32
#cat install.new | tr '/ ' ' ' > install.new

15:21:37
#cat install.new | tr '/' ' ' > install.new

15:21:42
#cat install.new

15:21:49
#cat install.new | tr ' ' ' ' >> install.new

15:22:05
#cat install.new

15:22:07
#cat install.new | tr ';' ' ' >> install.new

15:22:20
#cat install.new

15:22:22
#cat install.new | tr '"' ' ' >> install.new

15:22:34
#cat install.new

15:22:35
#cat install.new | tr '.' ' ' >> install.new

15:22:43
#cat install.new

15:22:57
#cat install.new
#!/bin/sh
hostname=`hostname`
uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f`
###############################################################################
#
# Set this variables before installation:
lilalo user=13-10-2014
lab=NT-LNet
install l3bashrc for this users=${users:-"root user"}  # users who will use l3agent and l3script
lilalo context="/users/${lilalo user}/${lab}/${hostname}"
...
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
cd /
rm -rf ${temp dir}
show final message
15:22:59
#cat install | tr '_' ' ' | tr '=' ' '| tr '"' ' ' | tr '~' ' ' > install.new

15:25:35
#cat install | tr '_' ' ' | tr '=' ' ' > install.new

15:26:40
#cat install | tr '_' ' ' | tr [:digit:]
tr: пропущен операнд после «[:digit:]»
При преобразовании необходимо задать две строки.
Попробуйте «tr --help» для получения более подробного описания.
15:28:27
#cat install | tr '_' ' ' | tr -d [:digit:]
#!/bin/sh
hostname=`hostname`
uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f`
###############################################################################
#
# Set this variables before installation:
lilalo user=--
lab=NT-LNet
install lbashrc for this users=${users:-"root user"}  # users who will use lagent and lscript
lilalo context="/users/${lilalo user}/${lab}/${hostname}"
...
step "Downloading lprompt" ${wget} ${url lprompt}
step "Downloading l-agent" '${wget} ${url lagent}; ${wget} ${url lconfig pm}; ${wget} ${url lconfig}'
step "Downloading perl modules for l-agent" '{ for i in ${perl modules}; do ${wget} ${url perl modules}/$i.tar.gz; done; }'
step "Installing perl modules for l-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 lbashrc to users home directories" install to users homes $install lbashrc for this users
step "Adding lbashrc invocation to ~/.bashrc " install to users bashrc $install lbashrc for this users
step "Adding l-agent invocation to ~/.bash profile " install to users bash profile $install lbashrc for this users
cd /
rm -rf ${temp dir}
show final message
15:28:48
#cat install | tr '_' ' ' | tr -d [:digit:] | tr -d [:punct:]
binsh
hostnamehostname
uname a  egrep qi freebsddarwin  hostnamehostname f
 Set this variables before installation
lilalo user
labNTLNet
install lbashrc for this usersusersroot user   users who will use lagent and lscript
lilalo contextuserslilalo userlabhostname
lilalo rclrc
lilalo homelilalo
...
step Downloading lprompt wget url lprompt
step Downloading lagent wget url lagent wget url lconfig pm wget url lconfig
step Downloading perl modules for lagent  for i in perl modules do wget url perl modulesitargz done
step Installing perl modules for lagent  for i in perl modules do tar xvfz itargz cd iz perl MakefilePL make make install cd  done
step Installing lbashrc to users home directories install to users homes install lbashrc for this users
step Adding lbashrc invocation to bashrc  install to users bashrc install lbashrc for this users
step Adding lagent invocation to bash profile  install to users bash profile install lbashrc for this users
cd
rm rf temp dir
show final message
15:29:35
#cat install | tr '_' ' ' | tr -d [:digit:] | tr -d [:punct:] | sort | unig
l3script: unig: команда не найдена
15:30:32
#cat install | tr '_' ' ' | tr -d [:digit:] | tr -d [:punct:] | sort | uniq
apt get install deps
apt get install thisperl make libmodulebuildperl libcdev gcc
        aptget install y apt get install this
binsh
    cat FINAL MESSAGE
          cat log  sed s
        cat log  sed s
    cat USAGE
cd
cd temp dir
...
url lprompturl lilalolprompt
url perl modulesurl lilalo
Usage
USAGE
Use commands
        user homeget user home user
    users
wgetwget
whiteCm
Your current lilalo context is lilalo contextUSER
15:30:59
#cat install | tr '_' ' ' | tr -d [:digit:] | tr -d [:punct:] | sort | uniq
apt get install deps
apt get install thisperl make libmodulebuildperl libcdev gcc
        aptget install y apt get install this
binsh
    cat FINAL MESSAGE
          cat log  sed s
        cat log  sed s
    cat USAGE
cd
cd temp dir
...
url lprompturl lilalolprompt
url perl modulesurl lilalo
Usage
USAGE
Use commands
        user homeget user home user
    users
wgetwget
whiteCm
Your current lilalo context is lilalo contextUSER
15:33:41
#cat install | tr '_' ' ' | tr -d [:digit:] | tr -d [:punct:] | sort
apt get install deps
apt get install thisperl make libmodulebuildperl libcdev gcc
        aptget install y apt get install this
binsh
    cat FINAL MESSAGE
          cat log  sed s
        cat log  sed s
    cat USAGE
cd
cd temp dir
...
Use commands
        user homeget user home user
        user homeget user home user
        user homeget user home user
    users
    users
    users
wgetwget
whiteCm
Your current lilalo context is lilalo contextUSER
15:33:50
#cat install | tr '_' ' ' | tr -d [:digit:] | tr -d [:punct:] | sort | uniq
apt get install deps
apt get install thisperl make libmodulebuildperl libcdev gcc
        aptget install y apt get install this
binsh
    cat FINAL MESSAGE
          cat log  sed s
        cat log  sed s
    cat USAGE
cd
cd temp dir
...
url lprompturl lilalolprompt
url perl modulesurl lilalo
Usage
USAGE
Use commands
        user homeget user home user
    users
wgetwget
whiteCm
Your current lilalo context is lilalo contextUSER
15:34:06
#cat install | tr '_' ' ' | tr -d [:digit:] | tr -d [:punct:] | uniq | sort
apt get install deps
apt get install thisperl make libmodulebuildperl libcdev gcc
        aptget install y apt get install this
binsh
    cat FINAL MESSAGE
          cat log  sed s
        cat log  sed s
    cat USAGE
cd
cd temp dir
...
Use commands
        user homeget user home user
        user homeget user home user
        user homeget user home user
    users
    users
    users
wgetwget
whiteCm
Your current lilalo context is lilalo contextUSER
15:35:30
#sed 's/:.*//' /etc/passwd
root
daemon
bin
sys
sync
games
man
lp
mail
news
...
list
irc
gnats
nobody
libuuid
Debian-exim
user
sshd
ivan
petr
15:36:26
#sed 's/[^a]//g' /etc/passwd |wc -c
71
15:37:13
#for i in *\ *
> do
> mv "$i" "'echo $i | sed 's/ /_/g' '"
> done
mv: не удалось выполнить stat для «* *»: Нет такого файла или каталога
15:38:58
#ls
install  install.new  ip.txt  passwd
15:39:25
#iconv -f CP1251 -t KOI8-R
áÏîëíÿ
çiconv: недопустимая входная последовательность в позиции 1
15:40:45
#iconv -f CP1251 -t KOI8-R
Âîïðîñ
çiconv: недопустимая входная последовательность в позиции 1
15:41:04
#iconv -f CP1251 -t KOI8-R
vopros
vopros
15:42:47
#ls
install  install.new  ip.txt  passwd
15:43:13
#>fdgh dfgh
l3script: dfgh: команда не найдена
15:43:28
#vi fdgh dfgh
--- /tmp/l3-saved-6537.10967.17672	2017-06-07 16:43:37.310159811 +0300
+++ fdgh	2017-06-07 16:43:51.870204431 +0300
@@ -0,0 +1,2 @@
+sge:wq
+
15:43:51
#ls
fdgh  install  install.new  ip.txt  passwd
15:43:55
#ls
fdgh  install  install.new  ip.txt  passwd

Четверг (06/08/17)

/dev/pts/0
08:11:07
#find /home -empty -type f -user ivan | xargs -i cp {} /tmp

прошло 16 минут
08:27:22
#rm /tmp/*
rm: невозможно удалить «/tmp/etccopy»: Это каталог
08:27:46
#cd /tmp

08:28:24
#ls -l
итого 4
drwxr-xr-x 2 user user 4096 Июн  7 13:38 etccopy
08:28:28
#ls
etccopy
08:28:32
#cd etccopy

08:28:43
#ls
adduser.conf            email-addresses  kernel-img.conf  motd            rpc
adjtime                 environment      ld.so.cache      mtab            rsyslog.conf
aliases                 fstab            ld.so.conf       nail.rc         screenrc
bash.bashrc             gai.conf         locale.alias     nanorc          securetty
bash_completion         group            locale.gen       networks        services
bindresvport.blacklist  host.conf        localtime        nsswitch.conf   shells
blkid.tab               hostname         login.defs       os-release      staff-group-for-usr-local
blkid.tab.old           hosts            logrotate.conf   pam.conf        sysctl.conf
ca-certificates.conf    hosts.allow      mailcap          passwd          timezone
console-cyrillic        hosts.deny       mailcap.order    profile         trafshow
crontab                 inittab          mailname         protocols       ucf.conf
debconf.conf            inputrc          manpath.config   rc.local        wgetrc
debian_version          insserv.conf     mime.types       reportbug.conf
deluser.conf            issue            mke2fs.conf      resolv.conf
discover-modprobe.conf  issue.net        modules          rmt
08:28:45
#cd

08:28:53
#find /home -empty -type f -user ivan -exec mv -v {} /tmp \;
«/home/ivan/test1245532» -> «/tmp/test1245532»
«/home/ivan/test12» -> «/tmp/test12»
«/home/ivan/test1245» -> «/tmp/test1245»
«/home/ivan/test1» -> «/tmp/test1»
«/home/ivan/test124» -> «/tmp/test124»
«/home/ivan/test124553» -> «/tmp/test124553»
«/home/ivan/test12455» -> «/tmp/test12455»
«/home/ivan/test» -> «/tmp/test»
«/home/ivan/test12455321» -> «/tmp/test12455321»
08:30:06
#ls /tmp
etccopy  test  test1  test12  test124  test1245  test12455  test124553  test1245532  test12455321
08:30:26
#tree `ivan/
> done
> ^C
08:30:52
#tree `ivan/
                       ~ivan/
/home/ivan/
├── d1
├── d2
│   └── d3
├── error.txt
├── files.txt
└── passwd
3 directories, 3 files
08:31:03
#find / -regex ".*\.jpe?g"

08:34:36
#find / -regex ".*\.jpe?g"
/home/petr/2fse3456.jpeg
/home/petr/23456.jpeg
/home/petr/234sg56.jpg
/home/petr/23456.jpg
08:35:21
#find ~ -mmin -5
/root/.lilalo
/root/.lilalo/.report.dat
/root/.lilalo/98425613843813393-1496902267.script
/root/.lilalo/98425613843813393-1496902267.info
08:39:49
#find ~ -mmin -5
/root/.lilalo
/root/.lilalo/.report.dat
/root/.lilalo/98425613843813393-1496902267.script
/root/.lilalo/98425613843813393-1496902267.info
08:39:51
#find ~ -regex '.*(\.tar\.gz|\.tgz|\.rpm)'

08:45:46
#find --help
Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]
default path is the current directory; default expression is -print
expression may consist of: operators, options, tests, and actions:
operators (decreasing precedence; -and is implicit where no others are given):
      ( EXPR )   ! EXPR   -not EXPR   EXPR1 -a EXPR2   EXPR1 -and EXPR2
      EXPR1 -o EXPR2   EXPR1 -or EXPR2   EXPR1 , EXPR2
positional options (always true): -daystart -follow -regextype
normal options (always true, specified before other expressions):
      -depth --help -maxdepth LEVELS -mindepth LEVELS -mount -noleaf
      --version -xdev -ignore_readdir_race -noignore_readdir_race
...
      -readable -writable -executable
      -wholename PATTERN -size N[bcwkMG] -true -type [bcdpflsD] -uid N
      -used N -user NAME -xtype [bcdpfls]
actions: -delete -print0 -printf FORMAT -fprintf FILE FORMAT -print
      -fprint0 FILE -fprint FILE -ls -fls FILE -prune -quit
      -exec COMMAND ; -exec COMMAND {} + -ok COMMAND ;
      -execdir COMMAND ; -execdir COMMAND {} + -okdir COMMAND ;
Report (and track progress on fixing) bugs via the findutils bug-reporting
page at http://savannah.gnu.org/ or, if you have no web access, by sending
email to <bug-findutils@gnu.org>.
08:46:06
#help finde
l3script: help: no help topics match `finde'.  Try `help help' or `man -k finde' or `info finde'.
08:46:26
#help find
l3script: help: no help topics match `find'.  Try `help help' or `man -k find' or `info find'.
08:46:28
#find --?
find: unknown predicate `--?'
08:46:37
#find ?
find: `?': Нет такого файла или каталога
08:46:40
#find
.
./.aptitude
./.aptitude/config
./fdgh
./.bashrc
./.lilalo
./.lilalo/29881736138199336-1496759837_1496759887_etc_profile.diff
./.lilalo/302332565272128541-1496732906_1496752966_root_passwd.diff
./.lilalo/302332565272128541-1496732906.script
./.lilalo/29881736138199336-1496759837.info
...
./passwd
./.bash_history_old
./.profile
./ip.txt
./.l3rc
./.viminfo
./.vim
./.vim/.netrwhist
./.bash_profile
./install
08:46:42
#help finde
l3script: help: no help topics match `finde'.  Try `help help' or `man -k finde' or `info finde'.
08:48:12
#find ~ -regex '.*(\.tar\.gz|\.tgz|\.rpm)'

08:48:16
#find ~ -regex `.*(\.tar\.gz|\.tgz|\.rpm)`
l3script: command substitution: line 1: syntax error near unexpected token `\.tar\.gz'
l3script: command substitution: line 1: `.*(\.tar\.gz|\.tgz|\.rpm)'
find: отсутствует аргумент у `-regex'
08:48:24
#find ~ -regex ".*(\.tar\.gz|\.tgz|\.rpm)"

08:48:41
#find ~ -regex '.*(\.tar\.gz|\.tgz|\.rpm)'

08:48:48
#find --help
Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]
default path is the current directory; default expression is -print
expression may consist of: operators, options, tests, and actions:
operators (decreasing precedence; -and is implicit where no others are given):
      ( EXPR )   ! EXPR   -not EXPR   EXPR1 -a EXPR2   EXPR1 -and EXPR2
      EXPR1 -o EXPR2   EXPR1 -or EXPR2   EXPR1 , EXPR2
positional options (always true): -daystart -follow -regextype
normal options (always true, specified before other expressions):
      -depth --help -maxdepth LEVELS -mindepth LEVELS -mount -noleaf
      --version -xdev -ignore_readdir_race -noignore_readdir_race
...
      -readable -writable -executable
      -wholename PATTERN -size N[bcwkMG] -true -type [bcdpflsD] -uid N
      -used N -user NAME -xtype [bcdpfls]
actions: -delete -print0 -printf FORMAT -fprintf FILE FORMAT -print
      -fprint0 FILE -fprint FILE -ls -fls FILE -prune -quit
      -exec COMMAND ; -exec COMMAND {} + -ok COMMAND ;
      -execdir COMMAND ; -execdir COMMAND {} + -okdir COMMAND ;
Report (and track progress on fixing) bugs via the findutils bug-reporting
page at http://savannah.gnu.org/ or, if you have no web access, by sending
email to <bug-findutils@gnu.org>.
08:48:59
#find -D opt
Predicate List:
[-print]
Eval Tree:
pred=[-print] type=primary prec=no cost=Nothing rate=1,0 side effects
no children.
Normalized Eval Tree:
pred=[-a] type=bi_op prec=and cost=Nothing rate=1,0 no side effects
no left.
right:
    pred=[-print] type=primary prec=no cost=Nothing rate=1,0 side effects
...
./passwd
./.bash_history_old
./.profile
./ip.txt
./.l3rc
./.viminfo
./.vim
./.vim/.netrwhist
./.bash_profile
./install
08:49:23
#find -D ~ -regex '.*\.(\.tar\.gz|\.tgz|\.rpm)'
find: Ignoring unrecognised debug flag `/root'
08:58:02
#ls /tmp

08:58:02
#ls

08:58:02
#'

08:58:02
=$2<=>$3<=>$4>=0 local_session_id=98425613843813393-1496902267 nonce=151 pid=11399 prompt=# pwd=/root raw_end=29090 raw_file=/root/.lilalo/98425613843813393-1496902267.script raw_output_start=29090 raw_start=27864 tab_seq=4 time=1496905082 uid=0' class='prompt'>#<>=$2<=>$3<=>$4>=0 && $1<256 && $2<256 && $3<256 && $4<256 && NF==4'

08:58:02
#'
                  set -o
allexport       off
braceexpand     on
emacs           on
errexit         off
errtrace        off
functrace       off
hashall         on
histexpand      on
history         on
...
notify          off
nounset         off
onecmd          off
physical        off
pipefail        off
posix           off
privileged      off
verbose         off
vi              off
xtrace          off
09:03:30
#ls /tmp

09:03:30
#ls

09:03:30
#'
                  set +o noclobber
09:04:22
#set -o
allexport       off
braceexpand     on
emacs           on
errexit         off
errtrace        off
functrace       off
hashall         on
histexpand      on
history         on
ignoreeof       off
...
notify          off
nounset         off
onecmd          off
physical        off
pipefail        off
posix           off
privileged      off
verbose         off
vi              off
xtrace          off
09:04:25
#set -o noclobber

09:04:32
#set -o
allexport       off
braceexpand     on
emacs           on
errexit         off
errtrace        off
functrace       off
hashall         on
histexpand      on
history         on
ignoreeof       off
...
notify          off
nounset         off
onecmd          off
physical        off
pipefail        off
posix           off
privileged      off
verbose         off
vi              off
xtrace          off
09:04:34
#ls /tmp

09:04:34
#ls

09:04:34
#'
                  stty -a
speed 38400 baud; rows 45; columns 114; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q;
stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke
09:06:05
#ls /tmp

09:06:05
#ls

09:06:05
#'
                  man bash | wc -l
4228
09:06:30
#ls /tmp

09:06:30
#ls

09:06:30
#'
                  help shopt
shopt: shopt [-pqsu] [-o] [optname ...]
    Set and unset shell options.
    Change the setting of each shell option OPTNAME.  Without any option
    arguments, list all shell options with an indication of whether or not each
    is set.
    Options:
      -o        restrict OPTNAMEs to those defined for use with `set -o'
      -p        print each shell option with an indication of its status
      -q        suppress output
      -s        enable (set) each OPTNAME
      -u        disable (unset) each OPTNAME
    Exit Status:
    Returns success if OPTNAME is enabled; fails if an invalid option is
    given or OPTNAME is disabled.
09:16:02
#find ~ -regex '.*(\.tar\.gz|\.tgz|\.rpm)' -regextype posix-egrep

09:16:03
#find -regextype posix-egrep ~ -regex '.*(\.tar\.gz|\.tgz|\.rpm)'
find: paths must precede expression: /root
Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]

Файлы

  • install.new
  • install.new
    >
    #!/bin/sh
    hostname=`hostname`
    uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f`
    ###############################################################################
    #
    # Set this variables before installation:
    lilalo user=13-10-2014
    lab=NT-LNet
    install l3bashrc for this users=${users:-"root user"}  # users who will use l3agent and l3script
    lilalo context="/users/${lilalo user}/${lab}/${hostname}"
    #
    ###############################################################################
    lilalo rc=.l3rc
    lilalo home=.lilalo
    url lilalo="http://xgu.ru/lilalo"
    url l3bashrc="${url lilalo}"/l3bashrc
    url l3agent="${url lilalo}"/l3-agent
    url l3config pm="${url lilalo}"/l3config.pm
    url l3config="${url lilalo}"/l3-config
    url l3prompt="${url lilalo}"/l3prompt
    url perl modules=${url lilalo}/
    perl modules="Term-VT102 Text-Iconv"
    apt get install this="perl make libmodule-build-perl libc6-dev gcc"
    wget=wget
    uname -a | egrep -qi '(bsd|darwin)' && wget=fetch
    normC='\033[0;39m'
    whiteC='\033[1;37m'
    redC='\033[0;31m'
    greenC='\033[0;32m'
    apt get install deps()
    {
        return 0
        if which apt-get >& /dev/null
        then
            apt-get install -y $apt get install this
        else
            echo "Please install this dependencies manually:"
            echo $apt get install this
            echo "Have you installed this already (y/n)?"
            echo y | read answer
            if echo $answer | grep -q ^[yY]
            then
                true
            else
                echo Please install the dependencies and rerun the script
                exit 1
            fi
        fi
    }
    step()
    {
        msg="$1"
        shift
        printf "${whiteC}""$msg""...${normC}\n"
    #    eval "$@" 2>&1 | sed 's/^/|\ \ \ /' && printf "Ok\n" || printf "Failed\n"
        eval "$@" 2>&1 > log 2>&1 && \
        {
              cat log | sed 's/^/|\ \ \ /'
              printf "${greenC}""Ok\n""${normC}"
        } || \
        {
            cat log | sed 's/^/|\ \ \ /'
            printf "${redC}""Failed\n""${normC}"
        }
    }
    get user home()
    {
        uname -a | egrep -qi '(freebsd|darwin)' && pw user show "$@"| awk -F: '{print $9}' || getent passwd "$@"| awk -F: '{print $6}'
    }
    install to users homes()
    {
        . l3bashrc
        users="$@"
        set -x
        for user in $users
        do
            user home=`get user home "$user"`
            mkdir -p ${user home}/${lilalo home}
            mkdir /etc/lilalo/
            cp l3config.pm /etc/lilalo/
            cp l3-agent /usr/local/bin
            cp l3-config /usr/local/bin
            ln -s `which bash` /usr/local/bin/l3script
            chmod 755 /usr/local/bin/l3-{agent,config}
            cp l3bashrc ${user home}/${lilalo home}
            cp l3prompt ${user home}/${lilalo home}
            chmod 755 ${user home}/${lilalo home}/l3prompt
            chown -R $user ${user home}/${lilalo home}
            echo l3cd=${lilalo context}/$user > ${user home}/${lilalo rc}
            chown -R $user ${user home}/${lilalo rc}
        done
        set +x
    }
    install to users bashrc()
    {
        users="$@"
        for user in $users
        do
            user home=`get user home "$user"`
            grep -q lilalo ${user home}/.bashrc 2> /dev/null\
            || echo "[ \$0 == l3script ] && . ${user home}/.lilalo/l3bashrc &&  l3 start" >> ${user home}/.bashrc; chown -R ${user} ${user home}/.bashrc
        done
    }
    install to users bash profile()
    {
        users="$@"
        for user in $users
        do
            user home=`get user home "$user"`
            grep -q l3-agent ${user home}/.bash profile 2> /dev/null \
            || { echo >> ${user home}/.bash profile ; cat ${user home}/.bash profile | sed '1s/^/l3-agentX/' | tr X '\n' > /tmp/$$$$l3 ; mv /tmp/$$$$l3 ${user home}/.bash profile; chown -R ${user} ${user home}/.bash profile; }
        done
    }
    show usage()
    {
        cat <<USAGE
    Usage:
        $0
    USAGE
    }
    show final message()
    {
        cat <<FINAL MESSAGE
    Installation is successfully completed.
    Now restart your shell or relogin
    to start script writing.
    Your current lilalo context is ${lilalo context}/USER
    If you use xgu.ru backend, your labs will be available at
    http://xgu.ru/l3/${lilalo context}
    Use commands
     $ l3cd ${lilalo context%/*/*}/MY-NEW-CONTEXT/${hostname}/USER
     $ l3pwd
    to change and to know your current context.
    For further information see http://xgu.ru/lilalo/ (in Russian).
    Thank you gor using LiLaLo.
    Happy Labbing!
    (don't forget to restart bash or relogin)
    FINAL MESSAGE
    }
    temp dir=/tmp/lilalo-install-temp-$$
    mkdir -p ${temp dir}
    cd ${temp dir}
    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
    cd /
    rm -rf ${temp dir}
    show final message
    

    Статистика

    Время первой команды журнала15:11:33 2017- 6- 7
    Время последней команды журнала09:16:03 2017- 6- 8
    Количество командных строк в журнале101
    Процент команд с ненулевым кодом завершения, %10.89
    Процент синтаксически неверно набранных команд, % 1.98
    Суммарное время работы с терминалом *, час 1.62
    Количество командных строк в единицу времени, команда/мин 1.04
    Частота использования команд
    cat36|==================| 18.95%
    tr29|===============| 15.26%
    find20|==========| 10.53%
    ls18|=========| 9.47%
    install.new13|======| 6.84%
    \.tgz8|====| 4.21%
    '7|===| 3.68%
    sort6|===| 3.16%
    \.rpm)'6|===| 3.16%
    >6|===| 3.16%
    uniq4|==| 2.11%
    cd3|=| 1.58%
    set3|=| 1.58%
    help3|=| 1.58%
    iconv3|=| 1.58%
    sed2|=| 1.05%
    tree2|=| 1.05%
    =>1|| 0.53%
    $3<1|| 0.53%
    2561|| 0.53%
    &1|| 0.53%
    rm1|| 0.53%
    wc1|| 0.53%
    $2<1|| 0.53%
    \.rpm)"1|| 0.53%
    \.rpm)`1|| 0.53%
    <1|| 0.53%
    fdgh1|| 0.53%
    for1|| 0.53%
    =01|| 0.53%
    xargs1|| 0.53%
    vi1|| 0.53%
    NF==4'1|| 0.53%
    $4<1|| 0.53%
    =$2<1|| 0.53%
    $4>1|| 0.53%
    $1<1|| 0.53%
    unig1|| 0.53%
    ____
    *) Интервалы неактивности длительностью 30 минут и более не учитываются

    Справка

    Для того чтобы использовать LiLaLo, не нужно знать ничего особенного: всё происходит само собой. Однако, чтобы ведение и последующее использование журналов было как можно более эффективным, желательно иметь в виду следующее:
    1. В журнал автоматически попадают все команды, данные в любом терминале системы.

    2. Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду w. В поле WHAT, соответствующем текущему терминалу, должна быть указана программа script.

    3. Команды, при наборе которых были допущены синтаксические ошибки, выводятся перечёркнутым текстом:
      $ l s-l
      bash: l: command not found
      

    4. Если код завершения команды равен нулю, команда была выполнена без ошибок. Команды, код завершения которых отличен от нуля, выделяются цветом.
      $ test 5 -lt 4
      Обратите внимание на то, что код завершения команды может быть отличен от нуля не только в тех случаях, когда команда была выполнена с ошибкой. Многие команды используют код завершения, например, для того чтобы показать результаты проверки

    5. Команды, ход выполнения которых был прерван пользователем, выделяются цветом.
      $ find / -name abc
      find: /home/devi-orig/.gnome2: Keine Berechtigung
      find: /home/devi-orig/.gnome2_private: Keine Berechtigung
      find: /home/devi-orig/.nautilus/metafiles: Keine Berechtigung
      find: /home/devi-orig/.metacity: Keine Berechtigung
      find: /home/devi-orig/.inkscape: Keine Berechtigung
      ^C
      

    6. Команды, выполненные с привилегиями суперпользователя, выделяются слева красной чертой.
      # id
      uid=0(root) gid=0(root) Gruppen=0(root)
      

    7. Изменения, внесённые в текстовый файл с помощью редактора, запоминаются и показываются в журнале в формате ed. Строки, начинающиеся символом "<", удалены, а строки, начинающиеся символом ">" -- добавлены.
      $ vi ~/.bashrc
      2a3,5
      >    if [ -f /usr/local/etc/bash_completion ]; then
      >         . /usr/local/etc/bash_completion
      >        fi
      

    8. Для того чтобы изменить файл в соответствии с показанными в диффшоте изменениями, можно воспользоваться командой patch. Нужно скопировать изменения, запустить программу patch, указав в качестве её аргумента файл, к которому применяются изменения, и всавить скопированный текст:
      $ patch ~/.bashrc
      В данном случае изменения применяются к файлу ~/.bashrc

    9. Для того чтобы получить краткую справочную информацию о команде, нужно подвести к ней мышь. Во всплывающей подсказке появится краткое описание команды.

      Если справочная информация о команде есть, команда выделяется голубым фоном, например: vi. Если справочная информация отсутствует, команда выделяется розовым фоном, например: notepad.exe. Справочная информация может отсутствовать в том случае, если (1) команда введена неверно; (2) если распознавание команды LiLaLo выполнено неверно; (3) если информация о команде неизвестна LiLaLo. Последнее возможно для редких команд.

    10. Большие, в особенности многострочные, всплывающие подсказки лучше всего показываются браузерами KDE Konqueror, Apple Safari и Microsoft Internet Explorer. В браузерах Mozilla и Firefox они отображаются не полностью, а вместо перевода строки выводится специальный символ.

    11. Время ввода команды, показанное в журнале, соответствует времени начала ввода командной строки, которое равно тому моменту, когда на терминале появилось приглашение интерпретатора

    12. Имя терминала, на котором была введена команда, показано в специальном блоке. Этот блок показывается только в том случае, если терминал текущей команды отличается от терминала предыдущей.

    13. Вывод не интересующих вас в настоящий момент элементов журнала, таких как время, имя терминала и других, можно отключить. Для этого нужно воспользоваться формой управления журналом вверху страницы.

    14. Небольшие комментарии к командам можно вставлять прямо из командной строки. Комментарий вводится прямо в командную строку, после символов #^ или #v. Символы ^ и v показывают направление выбора команды, к которой относится комментарий: ^ - к предыдущей, v - к следующей. Например, если в командной строке было введено:

      $ whoami
      
      user
      
      $ #^ Интересно, кто я?
      
      в журнале это будет выглядеть так:
      $ whoami
      
      user
      
      Интересно, кто я?

    15. Если комментарий содержит несколько строк, его можно вставить в журнал следующим образом:

      $ whoami
      
      user
      
      $ cat > /dev/null #^ Интересно, кто я?
      
      Программа whoami выводит имя пользователя, под которым 
      мы зарегистрировались в системе.
      -
      Она не может ответить на вопрос о нашем назначении 
      в этом мире.
      
      В журнале это будет выглядеть так:
      $ whoami
      user
      
      Интересно, кто я?
      Программа whoami выводит имя пользователя, под которым
      мы зарегистрировались в системе.

      Она не может ответить на вопрос о нашем назначении
      в этом мире.
      Для разделения нескольких абзацев между собой используйте символ "-", один в строке.

    16. Комментарии, не относящиеся непосредственно ни к какой из команд, добавляются точно таким же способом, только вместо симолов #^ или #v нужно использовать символы #=

    17. Содержимое файла может быть показано в журнале. Для этого его нужно вывести с помощью программы cat. Если вывод команды отметить симоволами #!, содержимое файла будет показано в журнале в специально отведённой для этого секции.
    18. Для того чтобы вставить скриншот интересующего вас окна в журнал, нужно воспользоваться командой l3shot. После того как команда вызвана, нужно с помощью мыши выбрать окно, которое должно быть в журнале.
    19. Команды в журнале расположены в хронологическом порядке. Если две команды давались одна за другой, но на разных терминалах, в журнале они будут рядом, даже если они не имеют друг к другу никакого отношения.
      1
          2
      3   
          4
      
      Группы команд, выполненных на разных терминалах, разделяются специальной линией. Под этой линией в правом углу показано имя терминала, на котором выполнялись команды. Для того чтобы посмотреть команды только одного сенса, нужно щёкнуть по этому названию.

    О программе

    LiLaLo (L3) расшифровывается как Live Lab Log.
    Программа разработана для повышения эффективности обучения Unix/Linux-системам.
    (c) Игорь Чубин, 2004-2008

    $Id$