Tools Practical By Samson Tanimawo, PhD Published May 7, 2026 4 min read

xargs for Bulk Operations

xargs runs commands in parallel.

Simple

ls | xargs rm runs rm on each file.

Faster than for-loop in shell.

Parallel

ls | xargs -P 4 -I {} cmd {} runs 4 parallel.

Speeds up bulk operations dramatically.

Be careful

xargs handles weird filenames poorly.

Use -0 with find -print0 for safety.