#xargs
3 one-liners with this tag.
All one-liners tagged xargs
Check the status code of all sitemap.xml URLs in parallel
$curl -s https://example.com/sitemap.xml | grep -oP '(?<=<loc>)[^<]+' | xargs -P 8 -I{} curl -o /dev/null -s -w '%{http_code} %{url_effective}\n' {} | grep -v '^200 ' | sort
Collect all URLs from a sitemap index
$curl -s https://example.com/sitemap_index.xml | grep -oP '(?<=<loc>)[^<]+' | xargs -n1 curl -s | grep -oP '(?<=<loc>)[^<]+' | sort -u
Run a WP-CLI command on every site in a multisite
$wp site list --field=url --path=/var/www/vhosts/example.com/httpdocs | xargs -r -I {} wp cache flush --url={} --path=/var/www/vhosts/example.com/httpdocs