User Tools

Site Tools


shellsnippets

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
shellsnippets [2008/06/11 12:53] – old revision restored 195.35.72.54shellsnippets [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 -type d -empty -exec rmdir {} \; +  $> 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"
 </code> </code>
 +
 +Or you could just use readlink, which also resolves symlinks:
 +
 +    $> readlink -f ~/.bashrc
 +    /home/andi/.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 /etc/profile.local   * you can put this function in a file that is sourced when you log in, for example /etc/profile.local
   * of course you can omit ''-P $3'' when you always print with your default printer   * of course you can omit ''-P $3'' when you always print with your default printer
-  * 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