How to delete multiple files at once in Bash on Linux?

前端 未结 7 701
有刺的猬
有刺的猬 2021-01-29 19:09

I have this list of files on a Linux server:

abc.log.2012-03-14
abc.log.2012-03-27
abc.log.2012-03-28
abc.log.2012-03-29
abc.log.2012-03-30
abc.log.2012-04-02
ab         


        
7条回答
  •  半阙折子戏
    2021-01-29 19:26

    if you want to delete all files that belong to a directory at once. For example: your Directory name is "log" and "log" directory include abc.log.2012-03-14, abc.log.2012-03-15,... etc files. You have to be above the log directory and:

    rm -rf /log/*
    

提交回复
热议问题