/l3/users/28-09-2015/NT-Ladm/debian5.net.nt/root :1 :2 :3 :4 :5 :6 :7 :8 :9 |
|
#env
SHELL=/bin/bash TERM=xterm HISTSIZE=2500 SSH_CLIENT=192.168.16.106 49157 22 L3_PARENT_TTY=/dev/pts/0 L3_TAMPERED_EDITORS= vi vim pico nano SSH_TTY=/dev/pts/0 USER=root HISTFILESIZE=2500 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin MAIL=/var/mail/root L3_SESSION_ID=3214919816900022178-1443510370 PWD=/root LANG=ru_RU.UTF-8 |
#export c
|
#env
SHELL=/bin/bash TERM=xterm HISTSIZE=2500 SSH_CLIENT=192.168.16.106 49157 22 L3_PARENT_TTY=/dev/pts/0 OLDPWD=/bin L3_TAMPERED_EDITORS= vi vim pico nano SSH_TTY=/dev/pts/0 USER=root HISTFILESIZE=2500 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin MAIL=/var/mail/root L3_SESSION_ID=3214919816900022178-1443510370 PWD=/root c=10 LANG=ru_RU.UTF-8 |
#bash
root@debian5:~# echo $c 10 root@debian5:~# exit exit |
#env
SHELL=/bin/bash TERM=xterm HISTSIZE=2500 SSH_CLIENT=192.168.16.106 49157 22 L3_PARENT_TTY=/dev/pts/0 OLDPWD=/bin L3_TAMPERED_EDITORS= vi vim pico nano SSH_TTY=/dev/pts/0 USER=root HISTFILESIZE=2500 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin MAIL=/var/mail/root L3_SESSION_ID=3214919816900022178-1443510370 PWD=/root c=10 LANG=ru_RU.UTF-8 |
#bash
root@debian5:~# PS1='[\u \A]\$ ' [root 10:34]# exit exit |
#test 4 -eq 4
|
#echo $?
0 |
#test 4 -eq 5
![]() |
#echo $?
1 |
#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. |
#ls
23423 234235232252352435 234g23 all install report shell.sh 23423523 234235325 234g23hgfdfh errors privet.sh shadow wetwet |
#ls -l
итого 32 -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 2640 Сен 29 11:22 all -rw-r--r-- 1 root root 348 Сен 29 11:21 errors -rw-r--r-- 1 root root 5380 Сен 29 14:31 install -rwxr--r-- 1 root root 40 Сен 29 10:59 privet.sh -rw-r--r-- 1 root root 36 Сен 29 11:30 report -rw-r----- 1 root root 1029 Сен 28 14:23 shadow -rwxr--r-- 1 root root 239 Сен 29 15:21 shell.sh -rw-r--r-- 1 root root 0 Сен 29 10:26 wetwet |
#chmod u-x privet.sh
|
#test -x privet.sh
![]() |
#echo $?
1 |
#test -x shell.sh
|
#echo $?
0 |
#[ -x shell.sh ]
|
#echo $?
0 |
#help [
[: [ arg... ] Evaluate conditional expression. This is a synonym for the "test" builtin, but the last argument must be a literal `]', to match the opening `['. [[ ... ]]: [[ expression ]] Execute conditional command. Returns a status of 0 or 1 depending on the evaluation of the conditional expression EXPRESSION. Expressions are composed of the same primaries used by the `test' builtin, and may be combined using the following operators: ( EXPRESSION ) Returns the value of EXPRESSION ! EXPRESSION True if EXPRESSION is false; else false EXPR1 && EXPR2 True if both EXPR1 and EXPR2 are true; else false EXPR1 || EXPR2 True if either EXPR1 or EXPR2 is true; else false When the `==' and `!=' operators are used, the string to the right of the operator is used as a pattern and pattern matching is performed. When the `=~' operator is used, the string to the right of the operator is matched as a regular expression. The && and || operators do not evaluate EXPR2 if EXPR1 is sufficient to determine the expression's value. Exit Status: 0 or 1 depending on value of EXPRESSION. |
#help ]
![]() l3script: help: no help topics match `]'. Try `help help' or `man -k ]' or `info ]'. |
#help [
[: [ arg... ] Evaluate conditional expression. This is a synonym for the "test" builtin, but the last argument must be a literal `]', to match the opening `['. [[ ... ]]: [[ expression ]] Execute conditional command. Returns a status of 0 or 1 depending on the evaluation of the conditional expression EXPRESSION. Expressions are composed of the same primaries used by the `test' builtin, and may be combined using the following operators: ( EXPRESSION ) Returns the value of EXPRESSION ! EXPRESSION True if EXPRESSION is false; else false EXPR1 && EXPR2 True if both EXPR1 and EXPR2 are true; else false EXPR1 || EXPR2 True if either EXPR1 or EXPR2 is true; else false When the `==' and `!=' operators are used, the string to the right of the operator is used as a pattern and pattern matching is performed. When the `=~' operator is used, the string to the right of the operator is matched as a regular expression. The && and || operators do not evaluate EXPR2 if EXPR1 is sufficient to determine the expression's value. Exit Status: 0 or 1 depending on value of EXPRESSION. |
#help [
[: [ arg... ] Evaluate conditional expression. This is a synonym for the "test" builtin, but the last argument must be a literal `]', to match the opening `['. [[ ... ]]: [[ expression ]] Execute conditional command. Returns a status of 0 or 1 depending on the evaluation of the conditional expression EXPRESSION. Expressions are composed of the same primaries used by the `test' builtin, and may be combined using the following operators: ( EXPRESSION ) Returns the value of EXPRESSION ! EXPRESSION True if EXPRESSION is false; else false EXPR1 && EXPR2 True if both EXPR1 and EXPR2 are true; else false EXPR1 || EXPR2 True if either EXPR1 or EXPR2 is true; else false When the `==' and `!=' operators are used, the string to the right of the operator is used as a pattern and pattern matching is performed. When the `=~' operator is used, the string to the right of the operator is matched as a regular expression. The && and || operators do not evaluate EXPR2 if EXPR1 is sufficient to determine the expression's value. Exit Status: 0 or 1 depending on value of EXPRESSION. |
#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
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 hist> (( expression )) if COMMANDS; then COMMANDS; [ elif C> . filename [arguments] jobs [-lnprs] [jobspec ...] or jobs > : kill [-s sigspec | -n signum | -sigs> ... export [-fn] [name[=value] ...] or ex> typeset [-aAfFgilrtux] [-p] name[=va> false ulimit [-SHacdefilmnpqrstuvx] [limit> fc [-e ename] [-lnr] [first] [last] o> umask [-p] [-S] [mode] fg [job_spec] unalias [-a] name [name ...] for NAME [in WORDS ... ] ; do COMMAND> unset [-f] [-v] [name ...] for (( exp1; exp2; exp3 )); do COMMAN> until COMMANDS; do COMMANDS; done function name { COMMANDS ; } or name > variables - Names and meanings of so> getopts optstring name [arg] wait [id] hash [-lr] [-p pathname] [-dt] [name > while COMMANDS; do COMMANDS; done help [-dms] [pattern ...] { COMMANDS ; } |
#help cd
cd: cd [-L|[-P [-e]]] [dir] Change the shell working directory. Change the current directory to DIR. The default DIR is the value of the HOME shell variable. The variable CDPATH defines the search path for the directory containing DIR. Alternative directory names in CDPATH are separated by a colon (:). A null directory name is the same as the current directory. If DIR begins with a slash (/), then CDPATH is not used. If the directory is not found, and the shell option `cdable_vars' is set, the word is assumed to be a variable name. If that variable has a value, its value is used for DIR. Options: -L force symbolic links to be followed -P use the physical directory structure without following symbolic links -e if the -P option is supplied, and the current working directory cannot be determined successfully, exit with a non-zero status The default is to follow symbolic links, as if `-L' were specified. Exit Status: Returns 0 if the directory is changed, and if $PWD is set successfully when -P is used; non-zero otherwise. |
#cd --help
![]() l3script: cd: --: неправильная опция cd: usage: cd [-L|[-P [-e]]] [dir] |
#which cd
![]() |
#which who
/usr/bin/who |
#which pwd
/bin/pwd |
#which kill
/bin/kill |
#ls -ld /var/spool/
drwxr-xr-x 5 root root 4096 Июн 27 2014 /var/spool/ |
#ls -ld /var/spool/mail
lrwxrwxrwx 1 root root 7 Июн 27 2014 /var/spool/mail -> ../mail |
#ls -ld /var/mail
drwxrwsr-x 2 root mail 4096 Сен 29 11:25 /var/mail |
#cd /var/spool/mail
|
#pwd
/var/spool/mail |
#/bin/pwd
/var/mail |
#pwd -P
/var/mail |
#man pwd
|
#pwd
/var/spool/mail |
#echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin |
#cd
|
#ls
23423 234235232252352435 234g23 all install report shell.sh 23423523 234235325 234g23hgfdfh errors privet.sh shadow wetwet |
#chmod u+x privet.sh
|
#pwd
/root |
#privet.sh
![]() l3script: privet.sh: команда не найдена |
#./privet.sh
Privet ! |
#PATH=$PATH:/root
|
#privet.sh
Privet ! |
#vi /etc/profile
|
#id -u
0 |
#id
uid=0(root) gid=0(root) группы=0(root) |
#id -u
0 |
#vi /etc/profile
--- /tmp/l3-saved-7671.1475.20785 2015-09-30 11:01:36.760319809 +0300 +++ /etc/profile 2015-09-30 11:03:08.840319809 +0300 @@ -2,7 +2,7 @@ # 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" + PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root" else PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games" fi |
#exit
![]() exit Есть приостановленные задачи. |
#privet.sh ivan
Privet Noname! |
#privet.sh
Privet ! |
#/etc/init.d/
![]() acpid killprocs rcS bootlogs kmod reboot bootmisc.sh motd rmnologin checkfs.sh mountall-bootclean.sh rsyslog checkroot-bootclean.sh mountall.sh screen-cleanup checkroot.sh mountdevsubfs.sh sendsigs console-cyrillic mountkernfs.sh single console-setup mountnfs-bootclean.sh ssh cron mountnfs.sh udev exim4 mtab.sh udev-mtab halt netdiag umountfs hostname.sh networking umountnfs.sh hwclock.sh procps umountroot kbd rc urandom keyboard-setup rc.local |
#/etc/init.d/rsyslog stop
[ ok ] Stopping enhanced syslogd: rsyslogd. |
#service rsyslog start
[ ok ] Starting enhanced syslogd: rsyslogd. |
#less /etc/init.d/rsyslog
|
#chmod u+x test.sh
|
#./test.sh
123456^C |
#./test.sh
![]() 1 2 ^C |
#chmod u+x test.sh
|
#./test.sh
![]() 1 2 ^C |
#vi test.sh
|
#./test.sh
1 2 3 4 5 6 7 8 9 10 |
#./test.sh 2 5
1 2 3 4 5 |
#echo $1
|
#vi test.sh
--- /tmp/l3-saved-13292.20422.24046 2015-09-30 11:22:12.880319808 +0300 +++ test.sh 2015-09-30 11:23:04.912319822 +0300 @@ -1,4 +1,5 @@ #!/bin/bash +echo "You enter $# parameters" declare -i i=1 while [ $i -le ${2:-10} ] do |
#./test.sh
![]() You enter 0 parameters 1 2 3 4 5 ^C |
#./test.sh 3
![]() You enter 1 parameters 1 2 3 ^C |
#./test.sh 2 3
You enter 2 parameters 1 2 3 |
#^C
![]() |
#vi test.sh
--- /tmp/l3-saved-13292.15070.17925 2015-09-30 11:24:03.992319808 +0300 +++ test.sh 2015-09-30 11:24:18.460319808 +0300 @@ -1,5 +1,7 @@ #!/bin/bash echo "You enter $# parameters" +echo $* +echo $0 declare -i i=1 while [ $i -le ${2:-10} ] do |
#./test.sh 2 3
You enter 2 parameters 2 3 ./test.sh 1 2 3 |
#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 |
#man pwconv
|
#useradd -m -n test
![]() useradd: невеÑнÑй клÑÑ -- «n» ÐÑполÑзование: useradd [паÑамеÑÑÑ] ÐÐÐ seradd -D useradd -D [паÑамеÑÑÑ] ÐаÑамеÑÑÑ: -b, --base-dir ÐÐÐ_ÐÐТ базовÑй каÑалог Ð´Ð»Ñ Ð´Ð¾Ð¼Ð°Ñнего каÑалога новой ÑÑÑÑной запиÑи -c, --comment ÐÐÐÐÐÐТÐÐ ÐРполе GECOS новой ÑÑÑÑной запиÑи -d, --home-dir ÐÐÐ_ÐÐТ домаÑний каÑалог новой ÑÑÑÑной запиÑи -D, --defaults показаÑÑ Ð¸Ð»Ð¸ измениÑÑ Ð½Ð°ÑÑÑойки ... -p, --password ÐÐÐ ÐÐÑÑной запиÑи -r, --system ÑоздаÑÑ ÑиÑÑемнÑÑ ÑÑÑÑнÑÑ Ð·Ð°Ð¿Ð¸ÑÑ -R, --root ÐÐТ_CHROOT каÑалог, в коÑоÑÑй вÑполнÑеÑÑÑ chroot -s, --shell ÐÐÐРновой ÑÑÑÑной запиÑи -u, --uid UID полÑзоваÑелÑÑкий ID новой ÑÑÑÑной запиÑи -U, --user-group ÑоздаÑÑ Ð³ÑÑÐ¿Ð¿Ñ Ñ Ñем же именем ÑÑо и Ñ Ð¿Ð¾Ð»ÑзоваÑÐµÐ»Ñ -Z, --selinux-user SEUSER иÑполÑзоваÑÑ Ñказанного SEUSER Ð´Ð»Ñ Ð¿Ð¾Ð»ÑзоваÑелÑÑкого ÑопоÑÑÐ°Ð²Ð»ÐµÐ½Ð¸Ñ SELinux |
#useradd -m -N test
|
#id test
uid=1003(test) gid=100(users) группы=100(users) |
#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 ... 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 test:x:1003:100::/home/test:/bin/sh |
#apt-get install sudo
Чтение списков пакетов… Готово Построение дерева зависимостей Чтение информации о состоянии… Готово НОВЫЕ пакеты, которые будут установлены: sudo обновлено 0, установлено 1 новых пакетов, для удаления отмечено 0 пакетов, и 66 пакетов не обновлено. Необходимо скачать 847 kБ архивов. После данной операции, объём занятого дискового пространства возрастёт на 1 885 kB. Получено:1 http://ftp.ua.debian.org/debian/ wheezy/main sudo amd64 1.8.5p2-1+nmu3 [847 kB] Получено 847 kБ за 0с (1 352 kБ/c) Выбор ранее не выбранного пакета sudo. (Чтение базы данных … на данный момент установлен 30081 файл и каталог.) Распаковывается пакет sudo (из файла …/sudo_1.8.5p2-1+nmu3_amd64.deb) … Обрабатываются триггеры для man-db … Настраивается пакет sudo (1.8.5p2-1+nmu3) … |
#vi /etc/sudoers
--- /tmp/l3-saved-13292.10992.6051 2015-09-30 14:07:55.380319806 +0300 +++ /etc/sudoers 2015-09-30 14:08:51.456319808 +0300 @@ -18,6 +18,7 @@ # User privilege specification root ALL=(ALL:ALL) ALL +ivan ALL=(ALL:ALL) ALL # Allow members of group sudo to execute any command %sudo ALL=(ALL:ALL) ALL |
#less /etc/rsyslog.conf
|
#cat /etc/pa
![]() pam.conf pam.d/ passwd passwd- |
#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 ... 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 test:x:1003:100::/home/test:/bin/sh anna:x:1004:1004::/home/anna:/bin/sh |
#chfn ivan
Изменение информации о пользователе ivan Введите новое значение или нажмите ENTER для выбора значения по умолчанию Полное имя []: Ivan Ivanov Номер комнаты []: 9D Рабочий телефон []: 101 Домашний телефон []: 111-11-11 Другое []: |
#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 ... 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:Ivan Ivanov,9D,101,111-11-11:/home/ivan:/bin/bash petr:x:1002:1002::/home/petr:/bin/bash test:x:1003:100::/home/test:/bin/sh anna:x:1004:1004::/home/anna:/bin/sh |
#finger
![]() l3script: finger: команда не найдена |
#apt-get install finger
Чтение списков пакетов… Готово Построение дерева зависимостей Чтение информации о состоянии… Готово НОВЫЕ пакеты, которые будут установлены: finger обновлено 0, установлено 1 новых пакетов, для удаления отмечено 0 пакетов, и 66 пакетов не обновлено. Необходимо скачать 20,5 kБ архивов. После данной операции, объём занятого дискового пространства возрастёт на 31,7 kB. Получено:1 http://ftp.ua.debian.org/debian/ wheezy/main finger amd64 0.17-15 [20,5 kB] Получено 20,5 kБ за 0с (145 kБ/c) Выбор ранее не выбранного пакета finger. (Чтение базы данных … на данный момент установлено 30150 файлов и каталогов.) Распаковывается пакет finger (из файла …/finger_0.17-15_amd64.deb) … Обрабатываются триггеры для man-db … Настраивается пакет finger (0.17-15) … |
#finger ivan
Login: ivan Name: Ivan Ivanov Directory: /home/ivan Shell: /bin/bash Office: 9D, 101 Home Phone: 111-11-11 On since Tue Sep 29 10:05 (EEST) on pts/2 from 192.168.16.106 6 minutes 35 seconds idle Mail last read Tue Sep 29 11:26 2015 (EEST) No Plan. |
#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 ... 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:Ivan Ivanov,9D,101,111-11-11:/home/ivan:/bin/bash petr:x:1002:1002::/home/petr:/bin/bash test:x:1003:100::/home/test:/bin/sh anna:x:1004:1004::/home/anna:/bin/sh |
#cat /etc/default/useradd
# Default values for useradd(8) # # The SHELL variable specifies the default login shell on your # system. # Similar to DHSELL in adduser. However, we use "sh" here because # useradd is a low level utility and should be as general # as possible SHELL=/bin/sh # # The default group for users ... # EXPIRE= # # The SKEL variable specifies the directory containing "skeletal" user # files; in other words, files such as a sample .profile that will be # copied to the new user's home directory when it is created. # SKEL=/etc/skel # # Defines whether the mail spool should be created while # creating the account # CREATE_MAIL_SPOOL=yes |
#useradd
![]() ÐÑполÑзование: useradd [паÑамеÑÑÑ] ÐÐÐ seradd -D useradd -D [паÑамеÑÑÑ] ÐаÑамеÑÑÑ: -b, --base-dir ÐÐÐ_ÐÐТ базовÑй каÑалог Ð´Ð»Ñ Ð´Ð¾Ð¼Ð°Ñнего каÑалога новой ÑÑÑÑной запиÑи -c, --comment ÐÐÐÐÐÐТÐÐ ÐРполе GECOS новой ÑÑÑÑной запиÑи -d, --home-dir ÐÐÐ_ÐÐТ домаÑний каÑалог новой ÑÑÑÑной запиÑи -D, --defaults показаÑÑ Ð¸Ð»Ð¸ измениÑÑ Ð½Ð°ÑÑÑойки по ÑмолÑÐ°Ð½Ð¸Ñ Ð´Ð»Ñ useradd ... -p, --password ÐÐÐ ÐÐÑÑной запиÑи -r, --system ÑоздаÑÑ ÑиÑÑемнÑÑ ÑÑÑÑнÑÑ Ð·Ð°Ð¿Ð¸ÑÑ -R, --root ÐÐТ_CHROOT каÑалог, в коÑоÑÑй вÑполнÑеÑÑÑ chroot -s, --shell ÐÐÐРновой ÑÑÑÑной запиÑи -u, --uid UID полÑзоваÑелÑÑкий ID новой ÑÑÑÑной запиÑи -U, --user-group ÑоздаÑÑ Ð³ÑÑÐ¿Ð¿Ñ Ñ Ñем же именем ÑÑо и Ñ Ð¿Ð¾Ð»ÑзоваÑÐµÐ»Ñ -Z, --selinux-user SEUSER иÑполÑзоваÑÑ Ñказанного SEUSER Ð´Ð»Ñ Ð¿Ð¾Ð»ÑзоваÑелÑÑкого ÑопоÑÑÐ°Ð²Ð»ÐµÐ½Ð¸Ñ SELinux |
#cat /etc/default/useradd
# Default values for useradd(8) # # The SHELL variable specifies the default login shell on your # system. # Similar to DHSELL in adduser. However, we use "sh" here because # useradd is a low level utility and should be as general # as possible SHELL=/bin/bash # # The default group for users ... # # Defines whether the mail spool should be created while # creating the account # CREATE_MAIL_SPOOL=yes GROUP=100 HOME=/home INACTIVE=-1 EXPIRE= SKEL=/etc/skel CREATE_MAIL_SPOOL=no |
# Default values for useradd(8) # # The SHELL variable specifies the default login shell on your # system. # Similar to DHSELL in adduser. However, we use "sh" here because # useradd is a low level utility and should be as general # as possible SHELL=/bin/bash # # The default group for users # 100=users on Debian systems # Same as USERS_GID in adduser # This argument is used when the -n flag is specified. # The default behavior (when -n and -g are not specified) is to create a # primary user group with the same name as the user being added to the # system. # GROUP=100 # # The default home directory. Same as DHOME for adduser # HOME=/home # # The number of days after a password expires until the account # is permanently disabled # INACTIVE=-1 # # The default expire date # EXPIRE= # # The SKEL variable specifies the directory containing "skeletal" user # files; in other words, files such as a sample .profile that will be # copied to the new user's home directory when it is created. # SKEL=/etc/skel # # Defines whether the mail spool should be created while # creating the account # CREATE_MAIL_SPOOL=yes GROUP=100 HOME=/home INACTIVE=-1 EXPIRE= SKEL=/etc/skel CREATE_MAIL_SPOOL=no
root:x:0: daemon:x:1: bin:x:2: sys:x:3: adm:x:4: tty:x:5: disk:x:6: lp:x:7: mail:x:8: news:x:9: uucp:x:10: man:x:12: proxy:x:13: kmem:x:15: dialout:x:20: fax:x:21: voice:x:22: cdrom:x:24:user floppy:x:25:user tape:x:26: sudo:x:27: audio:x:29:user dip:x:30:user www-data:x:33: backup:x:34: operator:x:37: list:x:38: irc:x:39: src:x:40: gnats:x:41: shadow:x:42: utmp:x:43: video:x:44:user sasl:x:45: plugdev:x:46:user staff:x:50: games:x:60: users:x:100: nogroup:x:65534: libuuid:x:101: crontab:x:102: Debian-exim:x:103: ssh:x:104: user:x:1000: ivan:x:1001: petr:x:1002:
pam.conf pam.d/ passwd 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 uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh proxy:x:13:13:proxy:/bin:/bin/sh www-data:x:33:33:www-data:/var/www:/bin/sh backup:x:34:34:backup:/var/backups:/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:Ivan Ivanov,9D,101,111-11-11:/home/ivan:/bin/bash petr:x:1002:1002::/home/petr:/bin/bash test:x:1003:100::/home/test:/bin/sh anna:x:1004:1004::/home/anna:/bin/sh
Время первой команды журнала | 09:30:16 2015- 9-30 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 13:20:00 2015- 9-30 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 101 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 7.92 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 1.98 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 1.32 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 1.27 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду 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