./startT.sh >>output_$(date "+%Y%m%d").log 2>&1
1、> 表示 输出到指定文件(覆盖)
>> 输出到指定文件,追加
root@ubuntu:/opt/tc/rebootSolf# echo "122">3.log
root@ubuntu:/opt/tc/rebootSolf# cat 3.log
122
root@ubuntu:/opt/tc/rebootSolf# echo "122">>3.log
root@ubuntu:/opt/tc/rebootSolf#
root@ubuntu:/opt/tc/rebootSolf# cat 3.log
122
122
root@ubuntu:/opt/tc/rebootSolf#
2 1> 或 1>> 正常标准输出
2> 或者 2>> 异常输出
root@ubuntu:/opt/tc/rebootSolf# ls / 1>>3.log
root@ubuntu:/opt/tc/rebootSolf# cat 3.log
bin
boot
dev
etc
home
root@ubuntu:/opt/tc/rebootSolf# ls /ddj 2>>4.log
root@ubuntu:/opt/tc/rebootSolf# ls