basic123456789101112printf "%-5s %-10s %-4s\n" No Name Markpgrep bash # get pid of bashcat /proc/pid/environ # get env varvar=value # assign valuevar = value # check equallength=${#var} calculate123456789101112# calculate only for intlet no1++$[ $no1 + 1 ]$(( $no1 +5 ))$(expr $no1 + 5 ) # calculate for floatecho "4 * 0.56" | bc # 2.24echo "scale=3;3/8" | bc # .375echo "obase=2;100" | bc # 1100100echo "obase=10;ibase=2;100" | bc # 4 std1234567891011121314151617181920# stdcmd 2>stderr.txt 1>stdout.txtcmd 2>&1 output.txtcmd &> output.txtcat a* 2> /dev/null# tee copycat a* | tee out.txt | cat -n # only stdin, no stderr# muti-line stdincat <<EOF>log.txttest1test2EOF array12345678910111213# arrayarray_var=(1 2 3 4 5 6)echo ${array_var[0]}echo ${array_var[*]} # allecho ${array_var[@]} # allecho ${#array_var[@]} # lendeclare -A ass_arrayass_array=([apple]=100 [orange]=150)echo "${ass_array[apple]}"echo "${!ass_array[*]}" # keyecho "${#ass_array[*]}" # len date12345datedate +%sdate --date "Jan 20 2001" +%A