1
0
mirror of https://github.com/cheat/cheat.git synced 2025-05-25 09:27:06 +02:00

Merge pull request from shigemk2/xargs-no-run-if-empty

Add cheatsheet for xargs --no-run-if-empty
This commit is contained in:
Chris Allen Lane 2017-11-19 08:13:07 -05:00 committed by GitHub
commit 2aa37432cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -10,3 +10,7 @@ find -name *.pdf | xargs -I{} rm -rf '{}'
# -n1 => One file by one file. ( -n2 => 2 files by 2 files )
find -name *.pdf | xargs -I{} -n1 echo '&{}='
# If find returns no result, do not run rm
# This option is a GNU extension.
find -name "*.pdf" | xargs --no-run-if-empty rm