Any reasons not to?
]]>karol wrote:That works as longs as the options used are "backwards-compatible".
what do you mean?
You're using pigz as a drop-in replacement of gzip. If pigz behaves same as gzip i.e. 'pigz --foo' does the same as 'gzip --foo', everything's fine, but when the apps interpret options in a different way or the new app has some mandatory options you could skip with the previous one - things will break.
]]>That works as longs as the options used are "backwards-compatible".
what do you mean?
]]>[]$ cat /etc/bash.bashrc.local
alias grep='grep --color=auto'
alias ll='ls -l --color=auto'
alias llh='ls -lh --color=auto'
alias l.='ls -d .* --color=auto'
alias ls='ls --color=auto'
#Do compression with all cores !!
#alias gzip='pigz'
#alias gunzip='unpigz'
#alias bzip2='pbzip2'
#alias bunzip2='pbunzip2'
#alias bzcat='pbzcat'
#alias xz='pxz'
function gzip(){
pigz $@
}
export -f gzip
function gunzip(){
unpigz $@
}
export -f gunzip
function bzip2(){
pbzip2 $@
}
export -f bzip2
function bunzip2(){
pbunzip2 $@
}
export -f bunzip2
function bzcat(){
pbzcat $@
}
export -f bzcat
function xz(){
pxz $@
}
export -f xz
Is there solution for this problem?
]]>One thing you may want to check: if you compress a file w/ pbzip2 and send it over to me, will I be able to uncompress it with bzip2?
I just did some testing by downloading the Linux kernel source, and then using bzip2 and pbzip2 to decompress and recompress it several times. In another terminal window I monitored the speed of each CPU core by running:
watch 'cat /proc/cpuinfo | grep MHz'
What I found out was that yes, the files created by either tool will be able to be decompressed with the other. However, if you use pbzip2 to decompress a file compressed with the regular bzip2, it will only use one core. Only when decompressing a file that was compressed with pbzip2 did pbzip2 use both CPU cores.
]]>Where would I put said alias? Would /etc/bashrc work?
Yes, it should work. I have them in /etc/bash.bashrc.local but I don't remember what's the difference ;P
One thing you may want to check: if you compress a file w/ pbzip2 and send it over to me, will I be able to uncompress it with bzip2?
]]>