- Linux Shell Scripting Cookbook(Third Edition)
- Clif Flynt Sarath Lakshman Shantanu Tushar
- 63字
- 2021-07-09 19:46:15
Getting ready
The xargs command should be the first command to appear after a pipe operator. It uses standard input as the primary data source and executes another command using the values it reads from stdin as command-line arguments for the new command. This example will search for the main string in a collection of C files:
ls *.c | xargs grep main