Skip to end of metadata
Go to start of metadata

Shell hacks

There are many nice collections, this is from Andrew
Here is anotherone.

tar over ssh

tar cf - . |ssh remotehost "cd /target/dir; tar xf -"

Tar a directory tree

(cd /orig/dir; tar cf - .) | (cd /targ/dir; tar xpf -)

Copying with a cp -R will mangle stuff sometimes. If you want to completely copy a tree, this command is the best way to do it. Additional tar options, like --same-owner, will let you keep things even more intact. Another way to do this is: "tar cfC - /orig/dir . |tar xpfC - /targ/dir". They should both do exactly the same thing, though the original example is perhaps a little easier to remember. * from Andrew

clone defective harddisk

usage

as per example

from here

Bash

While searching for some bash info Jason found a couple of really nice websites:

get rid of the comments of a file

sometimes with huge configuration files that are well explained and commented it is not clear what settings are taking effect, with

only lines that are not starting with # are displayed

change permissions of files or directories

delete files with the same name as their parent directory

Warning! This script deletes files!

Save the following as cleanme, in the directory you want it to go through

?
make it executable, and run it

Install and keep a certain version of a program

here with the example of rdiffbackup

for aptitude

for synaptics

shows the main board

lauch thunderbird from a different user on your desktop