mirror of
https://github.com/Erreur32/cheat.git
synced 2024-12-22 13:42:11 +01:00
Add cheatsheet for xargs --no-run-if-empty
This commit is contained in:
parent
cdf573a725
commit
2c10955690
1 changed files with 4 additions and 0 deletions
|
@ -10,3 +10,7 @@ find -name *.pdf | xargs -I{} rm -rf '{}'
|
||||||
# -n1 => One file by one file. ( -n2 => 2 files by 2 files )
|
# -n1 => One file by one file. ( -n2 => 2 files by 2 files )
|
||||||
|
|
||||||
find -name *.pdf | xargs -I{} -n1 echo '&{}='
|
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
|
||||||
|
|
Loading…
Reference in a new issue