看板 Linux 關於我們 聯絡資訊
※ 引述《piglon (TEST123)》之銘言: : 請問一下 : 我現在有一堆用數字當檔名的文字檔 : 分別在00到99的資料夾內 : 如果我想要刪除檔名在5000以上的檔案 : 我該怎麼做 : 我只會建立不會刪~"~ : 感謝 find -type f | while read f; if [ ${f} -gt 5000 ] && echo ${f}; done 確認了檔案名後把echo改成rm。 -- In heaven, all the interesting people are missing. -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 132.239.73.93
mathfeel:多了個if,請刪除。 10/26 13:27
piglon:太感激了謝謝!!!! 我馬上試一下 10/26 14:21
piglon:-bash: syntax error near unexpected token `done' 10/26 14:37
piglon:我去掉了if 結果還是錯誤... 10/26 14:38
mathfeel:把if改成do 10/26 15:10
guessi:後半段換成 [ ${f} -gt 5000 ] && echo ${f} 10/26 20:33
guessi:或是 if [ ${f} -gt 5000 ]; then echo ${f}; fi 10/26 20:40
guessi:請忽略以上兩個推文 那是錯的 thx 10/26 21:04