ITPub博客

首页 > Linux操作系统 > Linux操作系统 > [20171205]奇怪的文件名.txt

[20171205]奇怪的文件名.txt

原创 Linux操作系统 作者:lfree 时间:2017-12-05 16:56:11 0 删除 编辑

[20171205]奇怪的文件名.txt

--//今天在服务器发现在目录/usr/share/man/存在一个文件名.
# ls -lb /usr/share/man/ | head
total 932
-rw-r--r--  1 root root  10659 2016-04-21 11:16:24 \033[6~
drwxr-xr-x  5 root root   4096 2014-08-29 21:30:27 bg
drwxr-xr-x  5 root root   4096 2012-09-26 01:42:13 cs
drwxr-xr-x  5 root root   4096 2014-08-29 21:30:27 da
drwxr-xr-x  5 root root   4096 2012-09-26 01:42:13 de
drwxr-xr-x  5 root root   4096 2014-08-29 21:30:27 el
drwxr-xr-x 14 root root   4096 2012-09-26 01:42:14 en
drwxr-xr-x  5 root root   4096 2014-08-29 21:30:27 es
drwxr-xr-x  5 root root   4096 2014-08-29 21:30:27 fi

--//去年4月份建立的.我测试发现是4个字符.

# ls -d ???? > /tmp/aa1

# xxd -c 16 /tmp/aa1
0000000: 1b5b 367e 0a6d 616e 310a 6d61 6e32 0a6d  .[6~.man1.man2.m
0000010: 616e 330a 6d61 6e34 0a6d 616e 350a 6d61  an3.man4.man5.ma
0000020: 6e36 0a6d 616e 370a 6d61 6e38 0a6d 616e  n6.man7.man8.man
0000030: 390a 6d61 6e6e 0a                        9.mann.

--//字符"6"可见.

# head  ??6?
OPENSSL(1)                          OpenSSL                         OPENSSL(1)

 

NAME
       openssl - OpenSSL command line tool

SYNOPSIS
       openssl command [ command_opts ] [ command_args ]

--//估计不小心操作重定向导致的.

# mv ??6? xxxx
--// 看了一下对应man openssl的输出,应该可以删除.

--//实际上我感兴趣如何输入的.我看了"\e[6~"对应的键码是page down.关于这个,可以查看执行如下:

# infocmp linux | grep "\E\[6"
        khome=\E[1~, kich1=\E[2~, kmous=\E[M, knp=\E[6~, kpp=\E[5~,
        u6=\E[%i%d;%dR, u7=\E[6n, u8=\E[?6c, u9=\E[c,

# infocmp screen | grep "\E\[6"
        khome=\E[1~, kich1=\E[2~, kmous=\E[M, knp=\E[6~, kpp=\E[5~,

--//说明终端类型screen(tmux) 以及 linux都是一样的编码.
--//然后使用man terminfo查看文档:

Variable        Cap-     TCap    Description
Numeric         name     Code
....
key_next        knxt     %5       next key
key_npage       knp      kN       next-page key

--//这样可以猜测出编码是pagedown键.
--//这样创建这个文件就很容易了,建立一个空目录:

$ mkdir testb
$ cd testb
$ touch ^[[6~
$ ls -l
total 0
-rw-r--r-- 1 oracle oinstall 0 2017-12-05 16:50:37 ?[6~

--//touch 如何输入呢? 打入 touch 空格 ctrl+v+pagedown,这样就出现^[[6~.
--//这样情况多半是copy and paste惹的祸...

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/267265/viewspace-2148288/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
熟悉oracle相关技术,擅长sql优化,rman备份与恢复,熟悉linux shell编程。

注册时间:2008-01-03

  • 博文量
    4006
  • 访问量
    7969368