title: "Xargs Explained"
Youtube_Thumbnail: "https://img.youtube.com/vi/HK1wAV9x4-A/hqdefault.jpg"
sources:
- "https://www.youtube.com/watch?v=HK1wAV9x4-A&t=356s"
media_link: "https://www.youtube.com/watch?v=HK1wAV9x4-A&t=356s"
Authors: "[[TomNomNom]]"
contentPublished: 2024-01-15
noteCreated: 2026-01-08
description: "The xargs command explained.Previous video: https://www.youtube.com/watch?v=U2fsUy0viLA"
tags:
- "clippings"
- "video"
takeaways:
subjects:
Status: "🙏🏼 Want To Read"The xargs command explained.Previous video: https://www.youtube.com/watch?v=U2fsUy0viLA
find -exec action covered in previous videofind -exec:
find . -type f -exec sha1sum {} \;xargs:
find . -type f | xargs sha1sum-print0 flag with find to use null byte separator instead of newline
find . -type f -print0 | xargs -0 sha1sum-0 flag tells xargs to use null byte as separatorhost command with -t a flag to query A recordscat hostnames | xargs host -t asha1sum but fails for host command-n flag limits number of input lines passed to command at oncecat hostnames | xargs -n1 host -t a-I flag allows specifying where to place input in the command using a placeholdercat hostnames | xargs -I {} host -t a {} 8.8.8.8-I automatically implies -n1 behavior-P flag runs multiple commands in parallel using multiple CPU corescat hostnames | xargs -I {} -P 4 host -t a {} 8.8.8.8-P 4 runs 4 commands simultaneously, significantly fastertail command outputs only the end of input-n flag controls number of lines to output... | xargs ... | tail -n1