Hands-on task
This task is step 18 of the course “find and xargs: search and bulk operations”
Split a list into groups of three
The file /root/nums.txt contains twelve numbers, each on its own line. Regroup them so that the result has three numbers per line (space-separated), and write it to /root/grouped.txt. The task should be solved by xargs — by how many arguments it puts into a single command run.
Reference:xargs
What you'll practise:
- xargs
- command-line arguments
- stream processing
- grouping