1. File descriptor input: standard input stdin,0 output: standard output stdout,1 standard error stderr,2 &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;2.I/O redirection Input redirection < << Create files Here, commonly used in bash to create files or build menus cat /tmp/a.txt << EOF a:ls /etc/passwd b:ls /etc/default/useradd eof 3. Output redirection > >> > Overwrite output >> append output 4.set -C prohibit overrides redirect to existing file set +C close-C attribute >1 in set &NBSP;-C, force the use of overwrite redirection /dev/null :bit bucket, bit bucket 5. Error redirection 2> ,2> > 2> overlay 2>> append 6. Simultaneous redirection of standard output and error output command > /path/to/outfile 2> /path/to/outfile command & > /path/to/outfile command > /path/to/outfile 2>&1 7. Pipe Output two times results cat /etc/rc.d/ Arithmetic operations in the Rc.sysinit |tee /tmp/a.out |wc -l 8.bash declare -i: Shaping Variables &NBSP;-X: Environment Variables let varname= arithmetic expression 9.bash cannot perform floating-point operations, the result is rounded varname=$[ Arithmetic Expression] varname=$ ((arithmetic expression)) varname= ' expr $num 1+ $num 2 '
Linux Basics IX