use xargs to replace bash loop
I have no solution toward multi-options dealing command, When I come across this, I will have a bash script to achieve it.
But now, I find a ancient but marvel tool in linux called
xargs, I could skip the loop in bash for many situations.
The bash script shown above is what I used to do when I need to batchly dealing with folder files. But now, I could do it with only one line command:
Wow, how briliant is it, which save a lot of time and energy on writing and meditating bash structure.
But actually there can be more usefulness by ultilizing
xargs, for instance in
find command, you can implement complex command in just one line, instead of using bash looping.
More usage about the
xargs, please refer to
12 January 2014