/l3/users/20-10-2014/NT-Ladm/debian4.net.nt/root :1 :2 :3 :4 :5 :6 :7 :8 :9 :10 :11 :12 :13 :14 :15 :16 :17 |
|
#env
SHELL=/bin/bash TERM=xterm SSH_CLIENT=192.168.15.102 53477 22 L3_PARENT_TTY=/dev/pts/3 L3_TAMPERED_EDITORS= vi vim pico nano vi vim pico nano SSH_TTY=/dev/pts/2 USER=root PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin MAIL=/var/mail/root L3_SESSION_ID=2450011926377668-1413979926 a=1 PWD=/root LANG=ru_RU.UTF-8 |
#cat /etc/profile
![]() # /etc/profile: system-wide .profile file for the Bourne shell (sh(1)) # and Bourne compatible shells (bash(1), ksh(1), ash(1), ...). if [ "`id -u`" -eq 0 ]; then PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" else PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games" fi export PATH if [ "$PS1" ]; then if [ "$BASH" ] && [ "$BASH" != "/bin/sh" ]; then ... # The default umask is now handled by pam_umask. # See pam_umask(8) and /etc/login.defs. if [ -d /etc/profile.d ]; then for i in /etc/profile.d/*.sh; do if [ -r $i ]; then . $i fi done unset i fi |
#cat /etc/profile
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1)) # and Bourne compatible shells (bash(1), ksh(1), ash(1), ...). if [ "`id -u`" -eq 0 ]; then PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" else PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games" fi export PATH if [ "$PS1" ]; then if [ "$BASH" ] && [ "$BASH" != "/bin/sh" ]; then ... # The default umask is now handled by pam_umask. # See pam_umask(8) and /etc/login.defs. if [ -d /etc/profile.d ]; then for i in /etc/profile.d/*.sh; do if [ -r $i ]; then . $i fi done unset i fi |
#Ñмvim /etc/profile
![]() # PS1='\h:\w\$ ' fi if [ -f /etc/bash.bashrc ]; then # The default umask is now handled by pam_umask. . $i # See pam_umask(8) and /etc/login.defs. fi done HISTSIZE=1000 HISTFILESIZE=1000 ... ~ ~ ~ ~ ~ ~ ~ ~ ÐведиÑе :quit<Enter> Ð´Ð»Ñ Ð²ÑÑ Ð¾Ð´Ð° из Vim 41,9 ÐÐ½Ð¸Ð·Ñ [1]+ Stopped /usr/bin/vim "$@" |
#Ñмvim /etc/profile
![]() # PS1='\h:\w\$ ' fi if [ -f /etc/bash.bashrc ]; then # The default umask is now handled by pam_umask. . $i # See pam_umask(8) and /etc/login.defs. fi done HISTSIZE=1000 HISTFILESIZE=1000 ... ~ ~ ~ ~ ~ ~ ~ ~ ÐведиÑе :quit<Enter> Ð´Ð»Ñ Ð²ÑÑ Ð¾Ð´Ð° из Vim 41,9 ÐÐ½Ð¸Ð·Ñ [1]+ Stopped /usr/bin/vim "$@" |
#сls /home/user
![]() bigfile granata.jpg lpi 2 names press_any_key_to_continue.jpg text bin Light_Alloy_4.4.784_RC2_by_FAFNIR.exe man_smb_conf ogo.jpg proj touchlist freebsd.jpg lpi 1 matrix.jpg pamyatka.pdf sh |
#сls /home/user
bigfile granata.jpg lpi 2 names press_any_key_to_continue.jpg text bin Light_Alloy_4.4.784_RC2_by_FAFNIR.exe man_smb_conf ogo.jpg proj touchlist freebsd.jpg lpi 1 matrix.jpg pamyatka.pdf sh |
#./hello.sh > student
![]() l3script: ./hello.sh: bin/bash: плохой интерпретатор: Нет такого файла или каталога |
#./hello.sh > student
![]() l3script: ./hello.sh: bin/bash: плохой интерпретатор: Нет такого файла или каталога |
#./hello.sh student
![]() l3script: ./hello.sh: bin/bash: плохой интерпретатор: Нет такого файла или каталога |
#./hello.sh student
![]() l3script: ./hello.sh: bin/bash: плохой интерпретатор: Нет такого файла или каталога |
#vim hello.sh
![]() --- /tmp/l3-saved-17450.17083.10210 2014-10-22 15:42:03.817051240 +0300 +++ hello.sh 2014-10-22 15:43:31.581057158 +0300 @@ -1,2 +1,2 @@ #!bin/bash -echo privet | mail -s "Hello, $1" +echo privet | mail -s "Hello, $1" $1 |
#./hello.sh student
![]() l3script: ./hello.sh: bin/bash: плохой интерпретатор: Нет такого файла или каталога |
#./hello.sh student
![]() l3script: ./hello.sh: bin/bash: плохой интерпретатор: Нет такого файла или каталога |
#~
![]() l3script: ./hello.sh: bin/bash: плохой интерпретатор: Нет такого файла или каталога |
#~
![]() l3script: ./hello.sh: bin/bash: плохой интерпретатор: Нет такого файла или каталога |
#vim hello.sh
![]() --- /tmp/l3-saved-17450.21887.9349 2014-10-22 15:44:23.797044955 +0300 +++ hello.sh 2014-10-22 15:44:35.053054030 +0300 @@ -1,2 +1,2 @@ -#!bin/bash +#!/bin/bash echo privet | mail -s "Hello, $1" $1 |
#vim hello.sh
![]() --- /tmp/l3-saved-17450.18665.27283 2014-10-22 15:46:13.585047545 +0300 +++ hello.sh 2014-10-22 15:50:27.569040360 +0300 @@ -1,2 +1,5 @@ #!/bin/bash -echo privet | mail -s "Hello, $1" $1 +for $c_user [ in $* ] + do + echo privet | mail -s "Hello, $c_user" $c_user + done |
#vim hello.sh
![]() --- /tmp/l3-saved-17450.28373.25973 2014-10-22 15:51:36.821068908 +0300 +++ hello.sh 2014-10-22 15:51:56.373049457 +0300 @@ -1,5 +1,5 @@ #!/bin/bash -for $c_user [ in $* ] +for c_user in $* do echo privet | mail -s "Hello, $c_user" $c_user done |
#ls student/student
![]() ls: невозможно получить доступ к student/student: Это не каталог |
#ls student/student
![]() ls: невозможно получить доступ к student/student: Это не каталог |
#cat /var/mail/student
![]() From root@based-debian.net.nt Tue Oct 21 15:11:15 2014 Return-path: <root@based-debian.net.nt> Envelope-to: student@based-debian.net.nt Delivery-date: Tue, 21 Oct 2014 15:11:15 +0300 Received: from root by debian4.net.nt with local (Exim 4.80) (envelope-from <root@based-debian.net.nt>) id 1XgYHT-0002tT-6D for student@based-debian.net.nt; Tue, 21 Oct 2014 15:11:15 +0300 Date: Tue, 21 Oct 2014 15:11:15 +0300 To: student@based-debian.net.nt ... Date: Wed, 22 Oct 2014 15:52:03 +0300 To: student@based-debian.net.nt Subject: Hello, student User-Agent: Heirloom mailx 12.5 6/20/10 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <E1XgvOV-0004d2-H8@debian4.net.nt> From: root <root@based-debian.net.nt> privet |
#cat /var/mail/student
From root@based-debian.net.nt Tue Oct 21 15:11:15 2014 Return-path: <root@based-debian.net.nt> Envelope-to: student@based-debian.net.nt Delivery-date: Tue, 21 Oct 2014 15:11:15 +0300 Received: from root by debian4.net.nt with local (Exim 4.80) (envelope-from <root@based-debian.net.nt>) id 1XgYHT-0002tT-6D for student@based-debian.net.nt; Tue, 21 Oct 2014 15:11:15 +0300 Date: Tue, 21 Oct 2014 15:11:15 +0300 To: student@based-debian.net.nt ... Date: Wed, 22 Oct 2014 15:52:03 +0300 To: student@based-debian.net.nt Subject: Hello, student User-Agent: Heirloom mailx 12.5 6/20/10 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <E1XgvOV-0004d2-H8@debian4.net.nt> From: root <root@based-debian.net.nt> privet |
#ls -l
![]() итого 76 -rw-r--r-- 1 root root 0 Окт 22 13:49 1234567 -rw-r--r-- 3 root root 36 Окт 21 17:10 1.txt -rw-r--r-- 3 root root 36 Окт 21 17:10 2.txt lrwxrwxrwx 1 root root 11 Окт 20 12:03 3.txt -> /root/1.txt drwxr-xr-x 3 root root 4096 Окт 20 17:22 backup drwxr-xr-x 2 root root 4096 Окт 20 14:51 d1 drwxr-xr-x 3 root root 4096 Окт 20 14:42 d2 -rw-r--r-- 1 root root 0 Окт 20 15:35 f6 -rw-r--r-- 1 root root 0 Окт 20 15:35 f7 ... -rw-r--r-- 1 root root 953 Окт 21 16:52 newfile -rw-r--r-- 1 root root 953 Окт 22 11:52 passwd drwxr-xr-x 4 root root 4096 Окт 20 17:23 proj drwxr-xr-x 2 root root 4096 Окт 22 14:52 soft -rw-r--r-- 1 root root 0 Окт 22 15:41 student crw-r--r-- 1 root root 136, 3 Окт 20 13:40 student_con drwxr-xr-x 2 root root 4096 Окт 21 14:42 test -rw-r--r-- 1 root root 0 Окт 21 17:07 unsorted -rw-r--r-- 1 root root 4076 Окт 22 10:08 wget.txt -rw-r--r-- 1 root root 44 Окт 22 10:17 words |
#ls -l
итого 76 -rw-r--r-- 1 root root 0 Окт 22 13:49 1234567 -rw-r--r-- 3 root root 36 Окт 21 17:10 1.txt -rw-r--r-- 3 root root 36 Окт 21 17:10 2.txt lrwxrwxrwx 1 root root 11 Окт 20 12:03 3.txt -> /root/1.txt drwxr-xr-x 3 root root 4096 Окт 20 17:22 backup drwxr-xr-x 2 root root 4096 Окт 20 14:51 d1 drwxr-xr-x 3 root root 4096 Окт 20 14:42 d2 -rw-r--r-- 1 root root 0 Окт 20 15:35 f6 -rw-r--r-- 1 root root 0 Окт 20 15:35 f7 ... -rw-r--r-- 1 root root 953 Окт 21 16:52 newfile -rw-r--r-- 1 root root 953 Окт 22 11:52 passwd drwxr-xr-x 4 root root 4096 Окт 20 17:23 proj drwxr-xr-x 2 root root 4096 Окт 22 14:52 soft -rw-r--r-- 1 root root 0 Окт 22 15:41 student crw-r--r-- 1 root root 136, 3 Окт 20 13:40 student_con drwxr-xr-x 2 root root 4096 Окт 21 14:42 test -rw-r--r-- 1 root root 0 Окт 21 17:07 unsorted -rw-r--r-- 1 root root 4076 Окт 22 10:08 wget.txt -rw-r--r-- 1 root root 44 Окт 22 10:17 words |
#сз тщ_ашду_цшcp no_file_with_this_name /tmp
![]() cp: не удалось выполнить stat для «no_file_with_this_name»: Нет такого файла или каталога |
#сз тщ_ашду_цшcp no_file_with_this_name /tmp
![]() cp: не удалось выполнить stat для «no_file_with_this_name»: Нет такого файла или каталога |
#touch no_file_w/_this_name
![]() touch: невозможно выполнить touch для «no_file_w/_this_name»: Нет такого файла или каталога |
#touch no_file_w/_this_name
touch: невозможно выполнить touch для «no_file_w/_this_name»: Нет такого файла или каталога |
#touch 'no_file_w\/_this_name'
![]() touch: невозможно выполнить touch для «no_file_w\\/_this_name»: Нет такого файла или каталога |
#touch 'no_file_w\/_this_name'
![]() touch: невозможно выполнить touch для «no_file_w\\/_this_name»: Нет такого файла или каталога |
#cp -v 'no_file_with_this_name' /tmp
![]() «no_file_with_this_name» -> «/tmp/no_file_with_this_name» |
#cp -v 'no_file_with_this_name' /tmp
«no_file_with_this_name» -> «/tmp/no_file_with_this_name» |
#help test
![]() test: test [expr] Evaluate conditional expression. Exits with a status of 0 (true) or 1 (false) depending on the evaluation of EXPR. Expressions may be unary or binary. Unary expressions are often used to examine the status of a file. There are string operators and numeric comparison operators as well. The behavior of test depends on the number of arguments. Read the bash manual page for the complete specification. File operators: -a FILE True if file exists. ... arg1 OP arg2 Arithmetic tests. OP is one of -eq, -ne, -lt, -le, -gt, or -ge. Arithmetic binary operators return true if ARG1 is equal, not-equal, less-than, less-than-or-equal, greater-than, or greater-than-or-equal than ARG2. See the bash manual page bash(1) for the handling of parameters (i.e. missing parameters). Exit Status: Returns success if EXPR evaluates to true; fails if EXPR evaluates to false or an invalid argument is given. |
#help test
test: test [expr] Evaluate conditional expression. Exits with a status of 0 (true) or 1 (false) depending on the evaluation of EXPR. Expressions may be unary or binary. Unary expressions are often used to examine the status of a file. There are string operators and numeric comparison operators as well. The behavior of test depends on the number of arguments. Read the bash manual page for the complete specification. File operators: -a FILE True if file exists. ... arg1 OP arg2 Arithmetic tests. OP is one of -eq, -ne, -lt, -le, -gt, or -ge. Arithmetic binary operators return true if ARG1 is equal, not-equal, less-than, less-than-or-equal, greater-than, or greater-than-or-equal than ARG2. See the bash manual page bash(1) for the handling of parameters (i.e. missing parameters). Exit Status: Returns success if EXPR evaluates to true; fails if EXPR evaluates to false or an invalid argument is given. |
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1)) # and Bourne compatible shells (bash(1), ksh(1), ash(1), ...). if [ "`id -u`" -eq 0 ]; then PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" else PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games" fi export PATH if [ "$PS1" ]; then if [ "$BASH" ] && [ "$BASH" != "/bin/sh" ]; then # The file bash.bashrc already sets the default PS1. # PS1='\h:\w\$ ' if [ -f /etc/bash.bashrc ]; then . /etc/bash.bashrc fi else if [ "`id -u`" -eq 0 ]; then PS1='# ' else PS1='$ ' fi fi fi # The default umask is now handled by pam_umask. # See pam_umask(8) and /etc/login.defs. if [ -d /etc/profile.d ]; then for i in /etc/profile.d/*.sh; do if [ -r $i ]; then . $i fi done unset i fi
From root@based-debian.net.nt Tue Oct 21 15:11:15 2014 Return-path: <root@based-debian.net.nt> Envelope-to: student@based-debian.net.nt Delivery-date: Tue, 21 Oct 2014 15:11:15 +0300 Received: from root by debian4.net.nt with local (Exim 4.80) (envelope-from <root@based-debian.net.nt>) id 1XgYHT-0002tT-6D for student@based-debian.net.nt; Tue, 21 Oct 2014 15:11:15 +0300 Date: Tue, 21 Oct 2014 15:11:15 +0300 To: student@based-debian.net.nt User-Agent: Heirloom mailx 12.5 6/20/10 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-Id: <E1XgYHT-0002tT-6D@debian4.net.nt> From: root <root@based-debian.net.nt> Status: O Пнд Окт 20 11:53:38 EEST 2014 /root From root@based-debian.net.nt Tue Oct 21 15:11:44 2014 Return-path: <root@based-debian.net.nt> Envelope-to: student@based-debian.net.nt Delivery-date: Tue, 21 Oct 2014 15:11:44 +0300 Received: from root by debian4.net.nt with local (Exim 4.80) (envelope-from <root@based-debian.net.nt>) id 1XgYHw-0002to-Ev for student@based-debian.net.nt; Tue, 21 Oct 2014 15:11:44 +0300 Date: Tue, 21 Oct 2014 15:11:44 +0300 To: student@based-debian.net.nt User-Agent: Heirloom mailx 12.5 6/20/10 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-Id: <E1XgYHw-0002to-Ev@debian4.net.nt> From: root <root@based-debian.net.nt> Status: O Пнд Окт 20 11:53:38 EEST 2014 /root From root@based-debian.net.nt Wed Oct 22 15:44:38 2014 Return-path: <root@based-debian.net.nt> Envelope-to: student@based-debian.net.nt Delivery-date: Wed, 22 Oct 2014 15:44:38 +0300 Received: from root by debian4.net.nt with local (Exim 4.80) (envelope-from <root@based-debian.net.nt>) id 1XgvHK-0004cG-2v for student@based-debian.net.nt; Wed, 22 Oct 2014 15:44:38 +0300 Date: Wed, 22 Oct 2014 15:44:38 +0300 To: student@based-debian.net.nt Subject: Hello, student User-Agent: Heirloom mailx 12.5 6/20/10 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <E1XgvHK-0004cG-2v@debian4.net.nt> From: root <root@based-debian.net.nt> Status: RO privet From root@based-debian.net.nt Wed Oct 22 15:52:03 2014 Return-path: <root@based-debian.net.nt> Envelope-to: student@based-debian.net.nt Delivery-date: Wed, 22 Oct 2014 15:52:03 +0300 Received: from root by debian4.net.nt with local (Exim 4.80) (envelope-from <root@based-debian.net.nt>) id 1XgvOV-0004d2-H8 for student@based-debian.net.nt; Wed, 22 Oct 2014 15:52:03 +0300 Date: Wed, 22 Oct 2014 15:52:03 +0300 To: student@based-debian.net.nt Subject: Hello, student User-Agent: Heirloom mailx 12.5 6/20/10 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <E1XgvOV-0004d2-H8@debian4.net.nt> From: root <root@based-debian.net.nt> privet
Время первой команды журнала | 14:12:22 2014-10-22 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 15:58:35 2014-10-22 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 101 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 37.62 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 0.00 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 1.26 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 1.34 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду w. В поле WHAT, соответствующем текущему терминалу, должна быть указана программа script.
Команды, при наборе которых были допущены синтаксические ошибки, выводятся перечёркнутым текстом:
$ l s-l bash: l: command not found |
Если код завершения команды равен нулю, команда была выполнена без ошибок. Команды, код завершения которых отличен от нуля, выделяются цветом.
$ test 5 -lt 4 |
Команды, ход выполнения которых был прерван пользователем, выделяются цветом.
$ 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 |
Команды, выполненные с привилегиями суперпользователя, выделяются слева красной чертой.
# id uid=0(root) gid=0(root) Gruppen=0(root) |
Изменения, внесённые в текстовый файл с помощью редактора, запоминаются и показываются в журнале в формате ed. Строки, начинающиеся символом "<", удалены, а строки, начинающиеся символом ">" -- добавлены.
$ vi ~/.bashrc
|
Для того чтобы изменить файл в соответствии с показанными в диффшоте изменениями, можно воспользоваться командой patch. Нужно скопировать изменения, запустить программу patch, указав в качестве её аргумента файл, к которому применяются изменения, и всавить скопированный текст:
$ patch ~/.bashrc |
Для того чтобы получить краткую справочную информацию о команде, нужно подвести к ней мышь. Во всплывающей подсказке появится краткое описание команды.
Если справочная информация о команде есть, команда выделяется голубым фоном, например: vi. Если справочная информация отсутствует, команда выделяется розовым фоном, например: notepad.exe. Справочная информация может отсутствовать в том случае, если (1) команда введена неверно; (2) если распознавание команды LiLaLo выполнено неверно; (3) если информация о команде неизвестна LiLaLo. Последнее возможно для редких команд.
Большие, в особенности многострочные, всплывающие подсказки лучше всего показываются браузерами KDE Konqueror, Apple Safari и Microsoft Internet Explorer. В браузерах Mozilla и Firefox они отображаются не полностью, а вместо перевода строки выводится специальный символ.
Время ввода команды, показанное в журнале, соответствует времени начала ввода командной строки, которое равно тому моменту, когда на терминале появилось приглашение интерпретатора
Имя терминала, на котором была введена команда, показано в специальном блоке. Этот блок показывается только в том случае, если терминал текущей команды отличается от терминала предыдущей.
Вывод не интересующих вас в настоящий момент элементов журнала, таких как время, имя терминала и других, можно отключить. Для этого нужно воспользоваться формой управления журналом вверху страницы.
Небольшие комментарии к командам можно вставлять прямо из командной строки. Комментарий вводится прямо в командную строку, после символов #^ или #v. Символы ^ и v показывают направление выбора команды, к которой относится комментарий: ^ - к предыдущей, v - к следующей. Например, если в командной строке было введено:
$ whoami
user
$ #^ Интересно, кто я?в журнале это будет выглядеть так:
$ whoami
user
Интересно, кто я? |
Если комментарий содержит несколько строк, его можно вставить в журнал следующим образом:
$ whoami
user
$ cat > /dev/null #^ Интересно, кто я?
Программа whoami выводит имя пользователя, под которым мы зарегистрировались в системе. - Она не может ответить на вопрос о нашем назначении в этом мире.В журнале это будет выглядеть так:
$ whoami user
|
Комментарии, не относящиеся непосредственно ни к какой из команд, добавляются точно таким же способом, только вместо симолов #^ или #v нужно использовать символы #=
1 2 3 4Группы команд, выполненных на разных терминалах, разделяются специальной линией. Под этой линией в правом углу показано имя терминала, на котором выполнялись команды. Для того чтобы посмотреть команды только одного сенса, нужно щёкнуть по этому названию.
LiLaLo (L3) расшифровывается как Live Lab Log.
Программа разработана для повышения эффективности обучения Unix/Linux-системам.
(c) Игорь Чубин, 2004-2008