Explaining the 'find -mtime' command

后端 未结 4 1434
时光说笑
时光说笑 2020-12-09 15:30

I\'m trying to remove all the dateed logs except the most recent. Before I execute a script to remove the files, I want to of course test my commands to make sure I\'m bring

4条回答
  •  鱼传尺愫
    2020-12-09 16:26

    You can use the find command with mtime.

    For example:

     find /path of the folder -type f -mtime +30
    

    -type refers to file type.

    +30 refers to the date before the present date.

    For more options we can refer to the man page.

提交回复
热议问题