/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 |
|