linux - Unix - ls 命令将一些 "outputted"文本显示为文件

标签 linux unix ls

bash-3.2$ ls -ls
total 48
4 -rw-r--r--  1 hdoostie etrade  1545 Aug  8  2012 ~
4 drwxr-xr-- 11 hdoostie etrade  4096 Dec 28  2011 det-us
4 drwxr-xr--  6 hdoostie etrade  4096 Sep 18  2012 etaf
12 -rw-r--r--  1 hdoostie etrade 11867 Jul 31  2012 l:template name="expanded_search">
4 drwxr-xr--  8 hdoostie etrade  4096 Apr 22 11:31 neo
4 drwxr-xr--  5 hdoostie etrade  4096 Jan 29 14:36 neo-apps-skins
4 drwxr-xr--  5 hdoostie etrade  4096 Feb 16  2012 neo-webapp-prospect
4 drwxr-xr--  3 hdoostie etrade  4096 Feb 22  2012 site_04_uat_in_here
4 drwxr-xr--  3 hdoostie etrade  4096 Jun 20  2012 svntest
4 drwxr-xr--  3 hdoostie etrade  4096 Feb 23  2012 xborder_in_here

"l:template name="expanded_search">"是一些以某种方式显示为文件的文件内容。我如何“删除”这个"file"?

最佳答案

删除任何文件的方法,无论文件名包含什么字符,都是使用它的 inode 号。您可以使用:

ls -i

这将向您展示旁边带有 inode 编号的文件。然后您可以使用以下方法删除该文件:

find -ium [inode_number] -exec rm {} \;

但在这种情况下,只引用文件名也应该足够了:

rm 'l:template name="expanded_search">'

关于linux - Unix - ls 命令将一些 "outputted"文本显示为文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16243360/

相关文章:

linux - 无法打开与身份验证代理的连接(REVIEW)

c - 同步访问共享内存

C 打开和读取目​​录

c - 如何使用 scanf 函数从 ls -l 作为参数的结果中解析两个特定信息?

linux - 检测传入的 ssh 连接

regex - 使用 awk 脚本在两种模式之间拉取文本

c++ - while cin.get 在从文件加载时导致无限循环

linux - 如何递归搜索具有特定扩展名的文件?

linux - LibreOffice 无法在 CentOS 上运行

unix - Ocaml 找不到 Unix 模块