Tags » Xargs

Recognizing bash aliases in xargs

If you set an alias, say ‘alias grep=”grep –color”‘, in bash; xargs will not recognize it. It will simply execute the normal grep without the “–color” option. 30 more words

Cygwin

More: Array Subset, loop and xargs

Last week I had a requirement to fetch details of some records. For simplicity let’s assume records are id of some entity; I need to get details from an API for those id. 299 more words

Bash Script

Parellel processing in Bash

The command line has been the primary interface for Unixes for over 40 years now. It’s design is reminiscent of it’s terminal roots, and it has remained much the same in form and function for decades now. 1,691 more words

Bash

Remove all unused kernels

As you know, everytime there is an update for the kernel, the new kernel is installed while the old one is not automaticaly uninstalled, after several kernel updates you will find a large list of old kernels in the start grub menu . 143 more words

Tutorials

Using find command to search for a string in some text files

I always forget the command to search for the strings in files pasted here:

find . -name “pom.xml”| xargs -t -L 1 cat | grep stop… 63 more words

How to SCP in parallel?

Here is short script doing that, using xargs capabilities:

#!/bin/bash
SOURCE_DIR="/sourcedirectory"
TARGET_DIR="targetuser@targethost:/targetdirectory"
THREADS="8"
cd ${SOURCE_DIR}; find . -type f | xargs -n1 -P$THREADS -I% scp % ${TARGET_DIR}/%
Unix / Solaris / Linux

Remove Exif data from pictures

Exiftool can be used to strip the Exif data from jpeg images/pictures.

Install the app:

sudo apt-get install libimage-exiftool-perl

Read the current Exif tag data from an image (could also be *.jpg, etc) : 83 more words