type echo
內部命令
echo is a shell builtin
type printf
printf is a shell builtin
man echo
help echo
echo
顯示一行文本到標準輸出
-n 不換行輸出
echo -n "today is turdsay"
today is turdsay[root@centos65 ~]#
-e 啓用反斜線(\)逃逸符
echo -e "today is \turdsay"
today is urdsay
\\反斜線本身
echo -e "\\"
\
\a 警告聲
\b退一格
echo -e "\btoday is \btursday\b"
today istursday
\c以後的字符串將不在輸出
echo -e "today is \cthursday"
today is [root@centos65 ~]#
echo -e "\ctoday is thursday"
\e escape逃逸至輸出屏幕頂端
\f form feed 換頁
echo -e "today is\f thursday"
today is
thursday
\n 換行
echo -e "today is\n thursday"
today is
thursday
\r 回車(carriage retrun),與-c相反,顯示\r之後的字符
echo -e "today\r is thursday"
is thursday
\t 水平製表符(horizontal tab),tab縮進
echo -e "today\t is thursday"
today is thursday
\v垂直製表符(vertical tab),同\f
echo -e "today\v is thursday"
today
is thursday
\0NNN指定八進制數字,顯示爲相應的符號或字母,NNN表示三個整數
echo -e "\0123"
S
echo -e "\0133"
[
[root@centos65 ~]# echo -e "\0135"
]
\xHH指定十六進制的數字,顯示爲相應的字母或數字
echo -e "\x24"
$
-E禁用反斜線(\)逃逸符,默認爲禁用