【问题标题】:xarg, find and rm rm: cannot remove `./not': No such file or directoryxarg、find 和 rm rm:无法删除 `./not':没有这样的文件或目录
【发布时间】:2016-05-09 09:05:06
【问题描述】:

我正在关注this Wikipedia example 以查找和删除文件。

[jalal@galapagos-04] (5)$ touch 'not important_file'
[jalal@galapagos-04] (6)$ touch important_file
[jalal@galapagos-04] (7)$ ls
agreement.txt    cs_web          johns.txt            reverse_sorted_user.txt  songs.txt        users.txt*
awk_example.txt  good_users.txt  marks.txt            sed_example.txt          sorted_user.txt
cs.html          important_file  not\ important_file  softlink/                test@
[jalal@galapagos-04] (8)$ find . -name not\* | tail -1 | xargs rm
rm: cannot remove `./not': No such file or directory

知道如何解决这个问题吗?

【问题讨论】:

  • 请注意,important_file 现已消失!

标签: linux find xargs rm


【解决方案1】:

您链接到的xargs 文章详细讨论了如何使用空值或行终止处理来处理这些确切情况,但您甚至没有使用xargs

您复制了一个示例,旨在说明一些不起作用的东西。

【讨论】:

    猜你喜欢
    • 2018-01-17
    • 1970-01-01
    • 2017-08-07
    • 2022-11-03
    • 2013-07-12
    • 2012-07-28
    • 1970-01-01
    • 2019-09-06
    • 2022-07-21
    相关资源
    最近更新 更多