xargs
can be used to process output from other commands (such as find
) as argument to a new commands.
It can come very handy in many cases, here are 3:
1. Finding and deleting .zip
files:
$ find . -name "*.zip" -type f -print | xargs /bin/rm -f
SET FOREIGN_KEY_CHECKS=0; | |
TRUNCATE `identify_log`; | |
TRUNCATE `identify_statistics`; | |
TRUNCATE `ex_product_image`; | |
TRUNCATE `logistics_track_item`; | |
TRUNCATE `core_url_rewrite`; | |
ALTER TABLE `identify_log` AUTO_INCREMENT=1; | |
ALTER TABLE `identify_statistics` AUTO_INCREMENT=1; |