Check These Out
For instance:
$ find . -type f -name '*.wav' -print0 |xargs -0 -P 3 -n 1 flac -V8
will encode all .wav files into FLAC in parallel.
Explanation of xargs flags:
-P [max-procs]: Max number of invocations to run at once. Set to 0 to run all at once [potentially dangerous re: excessive RAM usage].
-n [max-args]: Max number of arguments from the list to send to each invocation.
-0: Stdin is a null-terminated list.
I use xargs to build parallel-processing frameworks into my scripts like the one here: http://pastebin.com/1GvcifYa
alias for psql command line; works similar for Oracles sqlplus commandline interface.
if you do not provide stdin you will end up in the db shell.
Takes an mpeg video and coverts it to a youtube compatible flv file.
The -r 25 sets the frame rate for PAL, for NTSC use 29.97
Print a git log (in reverse order) giving a reference relative to HEAD.
HEAD (the current revision) can also be referred to as HEAD~0
The previous revision is HEAD~1 then HEAD~2 etc.
.
Add line numbers to the git output, starting at zero:
$ ... | nl -v0 | ...
.
Insert the string 'HEAD~' before the number using sed:
$ ... | sed 's/^ \+/&HEAD~/'
.
Thanks to bartonski for the idea :-)
Searches all .php files for a static instantiation of a class and displays the class names along with their frequencies.
You can use this to directly dump from machine A (with dvd drive) to machine B (without dvd drive) . I used this to copy dvd using my friend's machine to my netbook. Above command is to be issued on machine B.
Advantages :
1) No wasting time dumping first to machine A and then copying to Machine B.
2) You dont need to use space on Machine A. In fact, this will work even when Machine A doesnt have enough hdd space to dump the DVD.
Use -C ssh option on slow networks (enables compression).
you can replace "dd if=/dev/dvd" with any ripping command as long as it spews the iso to stdout.
This method will also convert mac line endings.
It's allways strange for me to see sed and awk in the same command line if you can avoid it
When you have one of those (log)files that only has epoch for time (since no one will ever look at them as a date) this is a way to get the human readable date/time and do further inspection.
Mostly perl-fu :-/
My PS1