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

Vai*_*odi 20 linux command

在Linux中使用-n选项和ECHO命令有什么用.

echo -n
Run Code Online (Sandbox Code Playgroud)

请给我回答详细说明.

小智 50

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.
Run Code Online (Sandbox Code Playgroud)

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

  • 道具,对一个简单的问题有礼貌,有帮助的回应! (10认同)