Skip to content

Instantly share code, notes, and snippets.

@BenjaminHerbert
Last active October 14, 2016 11:38
Show Gist options
  • Save BenjaminHerbert/336a345dd9e1b4f0bf78539f9e4d9460 to your computer and use it in GitHub Desktop.
Save BenjaminHerbert/336a345dd9e1b4f0bf78539f9e4d9460 to your computer and use it in GitHub Desktop.
Anleitung für xargs

xargs

Der Linux-Befehl xargs erstellt aus einer Liste (von standard input) Kommandos und führt diese aus.

Aufruf

Befehl-1 | xargs Befehl-2

xargs erstellt aus Befehl-1 eine Liste und baut daraus Kommandos.

find und xargs

Will man Leerzeichen in Datei- und Ordnernamen richtig behandeln, so ruft man einen Befehl find mit dem Parameter -print0 auf. find . -name "*.tmp" -print0 | xargs -0 rm

Eingabe aus einer Datei verwenden

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment