我有一個基於Linux的服務器,我使用它來做一些文件管理並服務於我的多個其他服務器。參數列表太長錯誤rm命令
基本上這個服務器(服務器1說)取輸入作爲從其他服務器.MP3文件,並將其轉換爲其他文件格式(.WAV,.txt和.XML),併發送至其他服務器的詢問響應。
在一段時間內,我的這個文件夾(Say/Somepath/MyInputFolder)現在已經有數據需要刪除。
我試過rm -r *
命令,但它說:
Argument list too long
我也試過rm -r *.mp3
和rm -r *.txt
單獨刪除這些文件,但它給出了同樣的錯誤。
我試着解決上面這個問題,並得到了錯誤警告。
find . -name "*.txt" -maxdepth 1 -print0 | xargs -0 rm
find: warning: you have specified the -maxdepth option after a non-option argument -name, but options are not positional (-maxdepth affects tests specified before it as well as those specified after it). Please specify options before other arguments.
我該如何做到這一點?
也嘗試過這個鏈接中提到的參數http://en.kioskea.net/faq/1086-unable-to-delete-file-argument-list-too-long – Aditya