[QuickTipp] -bash: /bin/rm: Argument list too long

This post was published 10 years 10 months 28 days ago, so the post may be outdated.

Vor mehreren Wochen stand ich vor dem Problem, das temporäre Verzeichnis /tmp zu leeren: Beim Ausführen kam lediglich die wenig zufriedenstellende Rückmeldung /bin/rm: Argument list too long. Der Fehler scheint aufzutauchen, wenn das Argument mit der Liste der zu löschenden Dateien größer als 128 Kilobyte ist – welche sicherlich eine stolze Liste an Dateien ist… Zum Glück gibt es auch hierfür ausreichend Workarounds, die vielen Dateien dennoch auf einmal löschen zu können.

Zwei Möglichkeiten hierfür sind:
for i in *; do rm $i; done
…oder…
find -type f -print0 | xargs -0 rm

Abschließend bedanke ich mich bei dem Autor des Artikels unter sysadminslife.com für die Lösung!

Patrik Kernstock

May I introduce my self? I am Patrik Kernstock, 25 years old, perfectionist, born in Austria and living in Ireland, Cork. Me explained in short: Tech- and security enthusiast, series & movies junky. Interesting in Linux, Container-stuff and many software solutions by Microsoft, Veeam and VMware.

0 0 votes
Article Rating
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

1 Comment
newest
oldest most voted
Inline Feedbacks
View all comments
Martin

War sehr hilfreich danke 🙂

1
0
Would love your thoughts, please comment.x
()
x