Tags » Xargs

Searching large source trees in an efficient way on Linux

TL;DR

Here is the alias:

alias search 'find \!:1 -noleaf -type f -not -path "*/boost/*" -not -path "*/extensions/*" -print0 | xargs -0 -n 100 -P 8 grep -I --color -H -n \!:2*'
… 589 more words
Linux

Ubuntu: convert an MKV to AVI

Meisha, just like me, is a fan of Tom and Jerry. I have a good collection of Tom and Jerry videos. The only problem was all those videos are in mkv format and she had to open her laptop to watch those videos every time. 87 more words

Bash

Why `xargs head` print filename?

Given two files,
a.txt content is: A1, b.txt content is: B1

While execute printf "a.txt\nb.txt" | xargs head -1,

I hope it output… 82 more words

Linux

find command examples

Problem:
I needed to clean up after running tests

Solution:
Using find

$ tree
.
├── bin
│   └── hello
├── hello
│   ├── hello.py
│   └── __init__.py
├── requirements.txt
├── setup.py
└── tests
    ├── __init__.py
    └── test_hello.py

3 directories, 7 files
… 248 more words
Bash