pra*_*upd 1 linux special-characters
在我的一个 linux 日志文件中,我有如下非常奇怪的字符,( ^B
, ^D
, ^G
, ^H
, ^O
,^R
等)
^MhostIPAddress^R^L10.x.x.x
^N
^HappCategory^R^Bsupplychain
^O
^GappName^R^Deventstream
Run Code Online (Sandbox Code Playgroud)
如果我cat
的日志相同,
hostIPAddress
10.x.x.x
appGroupsupplychain
appNameeventstream
Run Code Online (Sandbox Code Playgroud)
或者那些只是终端的东西。我正在从 macos 机器上 ssh Linux 机器。
在 Linux 上,
prayagupd@prayagupd:~# bash --version
GNU bash, version 4.2.46(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Run Code Online (Sandbox Code Playgroud)
在 Macos 上,
$ bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin15)
Copyright (C) 2007 Free Software Foundation, Inc.
Run Code Online (Sandbox Code Playgroud)
这是显示控制字符的一种相当常见的方式。
例如,请参阅维基百科“控制字符”文章中的“在 ASCII”部分。
这^R
就是您按下Ctrl+R键盘所得到的结果。
至于为什么它们会出现在您的文件中,我不知道。也许它们只是作为分隔符使其他工具更容易解析日志文件?但这只是我的推测。