Skip to content

Xargs | Cheatsheet


Parallel File Search and Grep

adb shell find /data/data -name '*db' -type f -print0 \
| xargs -0 -n1 -P$(nproc) sh -c 'strings "$0"' \
| grep -i 'foo'

Parallel SQLite3 Database Dump

find /data/data -name '*db' -type f -print0 \
| xargs -0 -n1 -P$(nproc) sh -c 'echo .dump \
| sqlite3 "$0"'