`
hellosoft
  • 浏览: 56146 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

delete files with shell script

阅读更多
如果是一个文件,可以使用
if [ -f filename ]
then
  rm filename
fi



但是,如果是多个文件(例如,所有含有 20070102的文件),就不能使用了,需要替换为:


find filepath -name filenamepart -exec rm -f {} \;



(环境: CentOS5.0 shell script)
分享到:
评论

相关推荐

    UE(官方下载)

    UEStudio and UltraEdit provide a way for you to search and delete found lines from your files. This short tutorial provides the steps for searching for and deleting lines by writing a simple script. ...

    最全的oracle常用命令大全.txt

    from dba_tablespaces t, dba_data_files d where t.tablespace_name = d.tablespace_name group by t.tablespace_name; 2、查看表空间物理文件的名称及大小 select tablespace_name, file_id, file_name, ...

    RealThinClientSDK_v610_BETA

    instances in the "ShellScript" line and you should add the path to the RTC SDK Lib folder directly after each "-Fu/Developer/Embarcadero/fmi" instance. For example, if you have made the complete RTC...

    VB编程资源大全(英文源码 其它)

    rptparam.zip This program generates datareport with two parameter values set during runtime - using dataenvironment and Microsoft Jet.OLEDB 3.51<END><br>38,virus2.zip This project/program scans ...

    DebuggingWithGDB 6.8-2008

    2.3 Shell Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.4 Logging Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...

    最新版的DebuggingWithGDB7.05-2010

    2.1.1 Choosing Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1.2 Choosing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...

    ETL工具Kettle用户手册

    目录 Kettle 3.0 用户手册 ...................................................................................................................... 1 Kettle 3.0 用户手册 .....................................

    计算机应用技术(实用手册)

    Memory Testing: 524288k ok with 32M shared memory 内存为512兆 32兆的二级缓存 IDE Channel 0 master : None IDE Channel 0 Slave : None IDE Channel 1 master : HL-DT-STDVD-ROM GDR8164B 0L06 IDE Channel 1 ...

    网管教程 从入门到精通软件篇.txt

     diskpart [ /add |/delete] [device_name |drive_name |partition_name] [size]  参数 无  如果不带任何参数,diskpart 命令将启动 diskpart 的 Windows 字符模式版本。  /add  创建新的分区。  /delete...

Global site tag (gtag.js) - Google Analytics