shellsnippets
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
shellsnippets [2008/06/11 12:53] – old revision restored 195.35.72.54 | shellsnippets [2010/11/01 16:11] – 122.179.29.74 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Shell ====== | + | **====== Shell ====== |
===== Useful standard utilities ===== | ===== Useful standard utilities ===== | ||
Line 17: | Line 17: | ||
===== Delete empty directories ===== | ===== Delete empty directories ===== | ||
- | $> find . -depth | + | $> find . -type d -empty -delete |
===== Execute a local shellscript on a remote host ===== | ===== Execute a local shellscript on a remote host ===== | ||
- | $> cat script.sh |ssh user@host "bash -s" | + | $> cat script.sh |ssh user@host "bash -s":**Bold Text** |
Line 109: | Line 108: | ||
echo "The scripts absolute path is $p" | echo "The scripts absolute path is $p" | ||
</ | </ | ||
+ | |||
+ | Or you could just use readlink, which also resolves symlinks: | ||
+ | |||
+ | $> readlink -f ~/.bashrc | ||
+ | / | ||
===== Print ANSI colors ===== | ===== Print ANSI colors ===== | ||
Line 219: | Line 223: | ||
* you can put this function in a file that is sourced when you log in, for example / | * you can put this function in a file that is sourced when you log in, for example / | ||
* of course you can omit '' | * of course you can omit '' | ||
- | * on my machines, the duplex setting is ignored, it's always printing on one side of the paper | + | * on my machines, the duplex setting is ignored, it's always printing on one side of the paper** |
shellsnippets.txt · Last modified: 2012/12/16 11:28 by 2001:6f8:1c1a:0:922b:34ff:fe18:7138