Skip to content

Instantly share code, notes, and snippets.

@lbydev
lbydev / 3-xargs-tips.md
Created July 19, 2017 05:28 — forked from nepsilon/3-xargs-tips.md
3 xargs usage tips — First published in fullweb.io issue #26

3 xargs tips on the road to CLI mastery

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 
@lbydev
lbydev / custom.sql
Last active July 13, 2016 08:53 — forked from leek/_Magento1_DeleteTestData.md
Magento - Delete All Test Data
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;