【问题标题】:shell script for Centos boxCentos 盒子的 shell 脚本
【发布时间】:2014-10-28 10:13:50
【问题描述】:

我是 shell 脚本以及如何编写它们的新手。我想编写一个脚本,在特定目录(/mydir)中搜索所有扩展名为 .test 的文件,然后删除它们。

任何帮助将不胜感激。

【问题讨论】:

  • man find... 不用写脚本了。

标签: shell centos


【解决方案1】:
find /mydir -name '*.test' -delete

Find 是一个非常灵活的工具。请参阅man find 了解它可以做的所有事情。

【讨论】:

    猜你喜欢
    • 2015-05-15
    • 2013-09-06
    • 2021-02-02
    • 2015-10-03
    • 1970-01-01
    • 2019-01-21
    • 1970-01-01
    • 1970-01-01
    • 2017-10-18
    相关资源
    最近更新 更多