linux - col命令-b参数中backspace是什么意思?
ringa_lee
ringa_lee 2017-04-17 12:58:30
0
1
1065

以下是man col中关于-b参数的解释

-b, --no-backspaces
Do not output any backspaces, printing only the last character
written to each column position.

这里的backspace查字典应该是退格键的意思,但是鸟哥的书上却说成是反斜杠( \ ),我想不对,因为反斜杠的英文应该是backslash,自己试验了一下:

[root@localhost ~]# cat 1
\r\m^M
[root@localhost ~]# cat 1 | col -b
\r\m^M

结果显示-b这参数没效果(肯定是我不知道怎么用).
我现在不知道col这命令是怎么用的,鸟哥书上的命令在我的centos7.0上根部不起作用,鸟哥说以下的命令

[root@localhost ~]# man col > /root/col.man
[root@localhost ~]# vi /root/col.man

会在col.man内显示出类似^H,^Hl,^HPS等等乱七八糟的控制字符,但我看到的是正常的manpage,所以我对col这命令看来没法做实验也不知为啥

ringa_lee
ringa_lee

ringa_lee

reply all(1)
黄舟

Watch my demo. That ^H is the backspace character, which is entered by Ctrl-v Ctrl-h on the terminal.

sh10079 ~tmp
>>> cat > test
te^Hst
10080 ~tmp
>>> col < test | xxd
0000000: 7465 0873 740a                           te.st.
10081 ~tmp
>>> col -b < test | xxd
0000000: 7473 740a                                tst.
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!