linux 中echo 命令输出感叹号
001、直接使用双引号输出
[root@pc1 test2]# echo "hello world!" ## 双引号输出感叹号报错 -bash: !": event not found

002、测试转义字符
[root@pc1 test2]# ls [root@pc1 test2]# echo "hello world\!" ## 直接输出了转义字符 hello world\!

003、测试单引号
[root@pc1 test2]# ls [root@pc1 test2]# echo 'hello world!' hello world!

004、不使用任何符号
[root@pc1 test2]# ls [root@pc1 test2]# echo hello world! hello world!


浙公网安备 33010602011771号