Using xargs
Hey guys i have a hard time understanding xargs, what is it and what does it do?
|
You can pipe a list of arguments to xargs which can apply other commands to it.
Code:
find $HOME -name *.jpg | xargs ls -l You could use find's '-exec' option above but xargs is faster than that. |
And to explain the WHY of xargs ... when you have a direcotry with MANY
files, and use shell globbing of sorts you may encounter errors a la "argument list too long" or "too many arguments". xargs allows you to work around that. Cheers, Tink |
All times are GMT -5. The time now is 02:35 PM. |