-n选项,在Linux中使用ECHO命令

时间:2013-12-10 16:17:03

标签: linux command

在Linux中使用-n选项与ECHO命令有什么用。

echo -n

请给我回答详细说明。

1 个答案:

答案 0 :(得分:41)

man echo

 -n    Do not print the trailing newline character.  This may also be achieved by appending `\c' to the end of the string, as is done
       by iBCS2 compatible systems.  Note that this option as well as the effect of `\c' are implementation-defined in IEEE Std
       1003.1-2001 (``POSIX.1'') as amended by Cor. 1-2002.  Applications aiming for maximum portability are strongly encouraged to
       use printf(1) to suppress the newline character.

Linux的许多内置命令都有一个man页面(例如man ls),这是查看man ual而不必在线搜索的好方法。