mirror of
https://github.com/chubin/cheat.sheets
synced 2024-11-01 21:40:24 +00:00
fixed xargs errors + added own examples
This commit is contained in:
parent
02accd2ac3
commit
6af7057594
14
sheets/xargs
Normal file
14
sheets/xargs
Normal file
@ -0,0 +1,14 @@
|
||||
# find all file name ending with .pdf and remove them
|
||||
find -name \*.pdf | xargs rm
|
||||
|
||||
# if file name contains spaces you should use this instead
|
||||
find -name \*.pdf | xargs -I{} rm -rf '{}'
|
||||
|
||||
# Will show every .pdf like:
|
||||
# &toto.pdf=
|
||||
# &titi.pdf=
|
||||
# -n1 => One file by one file. ( -n2 => 2 files by 2 files )
|
||||
find -name \*.pdf | xargs -I{} -n1 echo '&{}='
|
||||
|
||||
# group words by three in a string
|
||||
seq 1 10 | xargs -n3 echo
|
Loading…
Reference in New Issue
Block a user