Skip to content
This repository has been archived by the owner on Jun 13, 2022. It is now read-only.

Latest commit

 

History

History
executable file
·
52 lines (37 loc) · 911 Bytes

2019-01-08-Linux命令-echo.md

File metadata and controls

executable file
·
52 lines (37 loc) · 911 Bytes
layout title subtitle date author header-img catalog tags typora-root-url
post
Linux命令-echo
"echo -e -n"
2019-01-08 04:23:20 -0800
Kingtous
img/post-bg-unix-linux.jpg
true
Linux
Shell
../../Kingtous.github.io-master

Linux命令-echo

  • -n

    • 不换号输出(echo 默认为换行输出)
  • -e 处理特殊字符

    • \a 发出警告声;

    • \b 删除前一个字符;

      • ~ echo -e "ae\bbc"
        abc
        ➜  ~ echo -e "a\bbc"
        bc
        ➜  ~ echo -e "a\b"
        a 
        ➜  ~ echo -e "a\bc"
        c
        #只有一个字符的话是不是不会删除?
    • \c 最后不加上换行符号;

    • \f 换行但光标仍旧停留在原来的位置;

    • \n 换行且光标移至行首;

    • \r 光标移至行首,但不换行;

    • \t 插入tab;

    • \v 与\f相同;

    • \\ 插入\字符;