Delete files less than a specific size

前端 未结 6 1023
情书的邮戳
情书的邮戳 2020-12-18 12:55

I would like to delete all files that are less than a specific size in a directory. Does anyone know if there is a Windows command that will do this? something like de

6条回答
  •  借酒劲吻你
    2020-12-18 13:25

    BTW: Using PowerShell (on Windows 10) was the easier way for me:

    I only did this on the directory where I wish to delete files smaller than 20MB:

    ls | where {$_.Length -lt 20mb} | Remove-Item
    

提交回复
热议问题