Archive for January, 2012

Simple arhive extracting alias in linux

0

Add this to your ~/.bashrc

extract () {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xvjf $1 && cd $(basename "$1" .tar.bz2) ;;
*.tar.gz) tar xvzf $1 && cd $(basename "$1" .tar.gz) ;;
*.tar.xz) tar Jxvf $1 && cd $(basename "$1" .tar.xz) ;;
*.bz2) bunzip2 $1 && cd $(basename "$1" /bz2) ;;
*.rar) unrar x $1 && cd $(basename "$1" .rar) ;;
*.gz) gunzip $1 && cd $(basename "$1" .gz) ;;
*.tar) tar xvf $1 && cd $(basename "$1" .tar) ;;
*.tbz2) tar xvjf $1 && cd $(basename "$1" .tbz2) ;;
*.tgz) tar xvzf $1 && cd $(basename "$1" .tgz) ;;
*.zip) unzip $1 && cd $(basename "$1" .zip) ;;
*.Z) uncompress $1 && cd $(basename "$1" .Z) ;;
*.7z) 7z x $1 && cd $(basename "$1" .7z) ;;
*) echo "don't know how to extract '$1'..." ;;
esac
else
echo "'$1' is not a valid file!"
fi
}

Now just type “extract filename” and you’re golden.

Show hidden files on Mac OS X Lion

0
ninja finder 300x284 Show hidden files on Mac OS X Lion
The easiest way how to show hidden files in finder is to run a command in terminal: 
  • Open the Terminal application (Applications > Utilities > Terminal.app)
  • Type in the following without the quotes “defaults write com.apple.Finder AppleShowAllFiles TRUE”
  • Hit the ‘Enter’ key
  • Restart the Finder by holding ‘Option’, click and hold on the icon. Click ‘Relaunch’
To hide them again use this command:
  • To re-hide the files type “defaults write com.apple.Finder AppleShowAllFiles FALSE”
  • Then restart the Finder again.
Go to Top