Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xargs #218

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Xargs #218

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions xargs
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
# To Find all file name ending with .pdf and remove them
find -name *.pdf | xargs rm -rf
---
syntax: bash
---

# if file name contains spaces you should use this instead
find -name *.pdf | xargs -I{} rm -rf '{}'
# Find all files whose names end with .pdf and remove them:
find -type f -name '*.pdf' | xargs rm -f

# If file names contain special characters, you should use this instead.
# Special characters include spaces, quotes, parenthesis, unicode, etc:
find -type f -name '*.pdf' -print0 | xargs --null rm -f

# Run 4 `rm` commands in parallel
find -name '*.pdf' | xargs --max-procs=4 rm -f

# Will show every .pdf like:
# &toto.pdf=
Expand Down