- Shell hacks
- tar over ssh
- Tar a directory tree
- clone defective harddisk
- Bash
- get rid of the comments of a file
- change permissions of files or directories
- delete files with the same name as their parent directory
- Install and keep a certain version of a program
- shows the main board
- lauch thunderbird from a different user on your desktop
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:
- http://www.ibm.com/developerworks/library/l-bash.html - a three part
series that gives a good context for using bash - starts simple, get's
complicated - http://linuxcommand.org/index.php - really nice site for shell
commands and shell scripting - they also have a nice reading list - http://tldp.org/LDP/abs/html/index.html - advanced scripting...
starts fast - goes faster
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