KitzKikz  KitzKikz: ShellTricks   RecentChanges 
 PopularPages 
 SearchPages 
 Home | Trail - ShellTricks
 
 

These are some unix shell (bash/ksh/tcsh/...) tricks I've collected. I'm placing them here because, typically I'm away from my personal machine when I most need one.


Fast Process Search (fps) - I'm constantly checking to see if a certain program or process is running. This helps reduce the typing and the clutter.
    function fps {
        (( $# )) &&
        ps -aux | sed -n "1p;/_µµµµ_µµµµ_fps_µµµµ_µµµµ_/d;/$1/p" ||
        echo "Usage: fps <search string>"
    }


Interesting button on an order form I saw: It deals with the issue of multiple clicks on a submission button by changing the name when the user first clicks on the button and ignoring additional clicks.

<script type='text/javascript'>

document.write("<INPUT TYPE='button' NAME='Submit'
   VALUE='Submit Secure Order' onClick=\"if(this.value ==
   'Submit Secure Order') this.form.submit();
   this.value = 'Working...Please Wait.';\">");
// -->
</script>
<noscript>
<INPUT TYPE='submit' NAME='Submit' VALUE='Submit Secure Order'>
</noscript>


List All Available Man Pages:

man --path | perl -pe 's/:/\n/g' | xargs -J% -n1 find % -type f | xargs basename | sort -u


Dos2Unix Line Ending Conversion:

perl -pi -e 's/\r\n/\n/;' filename ...


Subtract Files
Output all lines in FileA not also in FileB

sort FileA | uniq | sort - FileB FileB | uniq -u
FileAFileBResult
a
a
b
c
d
e
c
d
e
f
g
a
b

 

   

 
 EditThisPage · LinksToPage · PageInfo 04/13/06 20:05:07  ·  0.0383s