carfield.com.hk text.txt 2017-08-06T09:21:16Z 2017-08-06T09:21:16Z <br/>10 awk tips - <a href="http://www.catonmat.net/blog/ten-awk-tips-tricks-and-pitfalls/">http://www.catonmat.net/blog/ten-awk-tips-tricks-and-pitfalls/</a> <br/><br/>8 Powerful Awk Built-in Variables – FS, OFS, RS, ORS, NR, NF, FILENAME, FNR - <a href="http://www.thegeekstuff.com/2010/01/8-powerful-awk-built-in-variables-fs-ofs-rs-ors-nr-nf-filename-fnr/">http://www.thegeekstuff.com[..]iables-fs-ofs-rs-ors-nr-nf-filename-fnr/</a> <br/><br/>Tutorial of text editing commands - <a href="http://www.ibm.com/developerworks/aix/library/au-unixtext/index.html">http://www.ibm.com[..]works/aix/library/au-unixtext/index.html</a> <br/><br/>wc and nl tutorial - <a href="http://www.thegeekstuff.com/2013/02/wc-nl-examples/">http://www.thegeekstuff.com/2013/02/wc-nl-examples/</a> <a href="https://enkipro.com/insight/558ac712249a234c00842b68">https://enkipro.com/insight/558ac712249a234c00842b68</a> <br/><br/>tips for uniq, like show only items have duplications - <a href="http://www.thegeekstuff.com/2013/05/uniq-command-examples/">http://www.thegeekstuff.com/2013/05/uniq-command-examples/</a> <br/><br/>Tips of "cat", include display by column and by delimiter - <a href="http://www.thegeekstuff.com/2013/06/cut-command-examples/">http://www.thegeekstuff.com/2013/06/cut-command-examples/</a> <br/><br/>Using lynx to convert HTML to text - <a href="https://enkipro.com/insight/558aaea45800843200bca364">https://enkipro.com/insight/558aaea45800843200bca364</a> <br/><br/><script type="text/javascript"><!--google_ad_client = "pub-9426659565807829";google_ad_slot = "9359905831";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> 2017-08-06T09:21:16Z file.txt 2017-08-06T09:20:16Z 2017-08-06T09:20:16Z <br/>Various ways to working with file - <a href="http://www.catonmat.net/blog/bash-one-liners-explained-part-one/">http://www.catonmat.net/blog/bash-one-liners-explained-part-one/</a> <br/><br/>Use truncate to pad the file size up - <a href="http://www.lainoox.com/truncate-shrink-extend-files/">http://www.lainoox.com/truncate-shrink-extend-files/</a> <br/><br/>Making a file unalterable with chattr - <a href="https://enkipro.com/insight/558ac712249a234c00842b68">https://enkipro.com/insight/558ac712249a234c00842b68</a> <br/><br/><script type="text/javascript"><!--google_ad_client = "pub-9426659565807829";google_ad_slot = "9359905831";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> 2017-08-06T09:20:16Z development.txt 2017-06-14T10:34:19Z 2017-06-14T10:34:19Z <br/>A bash debugger - <a href="http://bashdb.sourceforge.net/">http://bashdb.sourceforge.net/</a> <br/><br/>Really really good tips - <a href="http://fahdshariff.blogspot.com.au/2013/10/shell-scripting-best-practices.html">http://fahdshariff.blogspot.com.au[..]3/10/shell-scripting-best-practices.html</a> <br/><br/>Style guide - <a href="http://www.kfirlavi.com/blog/2012/11/14/defensive-bash-programming">http://www.kfirlavi.com[..]og/2012/11/14/defensive-bash-programming</a> <br/><br/>Script checker - <a href="https://www.shellcheck.net/">https://www.shellcheck.net/</a> <br/><br/>How to write a shell - <a href="https://indradhanush.github.io/blog/writing-a-unix-shell-part-1">https://indradhanush.github.io/blog/writing-a-unix-shell-part-1</a> <a href="https://indradhanush.github.io/blog/writing-a-unix-shell-part-2">https://indradhanush.github.io/blog/writing-a-unix-shell-part-2</a> <br/><br/><script type="text/javascript"><!--google_ad_client = "pub-9426659565807829";google_ad_slot = "9359905831";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> 2017-06-14T10:34:19Z bash.txt 2016-04-01T03:29:26Z 2016-04-01T03:29:26Z <br/>How to use eval, hash, readonly, shift, getopts, set, unset, let and shopt - <a href="http://www.thegeekstuff.com/2010/08/bash-shell-builtin-commands">http://www.thegeekstuff.com/2010/08/bash-shell-builtin-commands</a> <br/><br/>Sample bash completion<br/><br/>SSH_COMPLETE=( $(cut -f1 -d' ' ~/.ssh/known_hosts |\<br/> tr ',' '\n' |\<br/> sort -u |\<br/> grep -e '[:alpha:]') )<br/>complete -o default -W "${SSH_COMPLETE[*]}" ssh<br/><br/><a href="http://kasparov.skife.org/blog/stuff/starting-a-meme.html">http://kasparov.skife.org/blog/stuff/starting-a-meme.html</a> <br/><br/>Check history statistic - brianm@binky:~$ history | awk {'print $2'} | sort | uniq -c | sort -k1 -rn | head<br/> 164 svn<br/> 52 cd<br/> 42 ssh<br/> 32 sudo<br/> 22 git<br/> 16 ls<br/> 16 for<br/> 14 echo<br/> 13 man<br/> 10 curl<br/>brianm@binky:~$<br/><br/><a href="http://bluebones.net/2008/04/history-meme/">http://bluebones.net/2008/04/history-meme/</a> <br/><br/>easy way to do "[-h|--help][-n|--name <name>]" - <a href="http://binkley.blogspot.com/2016/03/bash-long-options.html">http://binkley.blogspot.com/2016/03/bash-long-options.html</a> <br/><br/><script type="text/javascript"><!--google_ad_client = "pub-9426659565807829";google_ad_slot = "9359905831";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> 2016-04-01T03:29:26Z grep.txt 2016-02-03T14:01:03Z 2016-02-03T14:01:03Z <br/>count, highlight and by position - <a href="http://www.thegeekstuff.com/2009/03/15-practical-unix-grep-command-examples/">http://www.thegeekstuff.com[..]15-practical-unix-grep-command-examples/</a> <br/><br/>Few examples of how to use grep - <a href="http://www.thegeekstuff.com/2011/10/grep-or-and-not-operators">http://www.thegeekstuff.com/2011/10/grep-or-and-not-operators</a> <a href="http://javarevisited.blogspot.com/2011/06/10-examples-of-grep-command-in-unix-and.html">http://javarevisited.blogspot.com[..]xamples-of-grep-command-in-unix-and.html</a> <br/><br/>Using regex - <a href="http://www.thegeekstuff.com/2011/01/regular-expressions-in-grep-command/">http://www.thegeekstuff.com[..]/01/regular-expressions-in-grep-command/</a> <a href="http://www.thegeekstuff.com/2011/01/advanced-regular-expressions-in-grep-command-with-10-examples-%E2%80%93-part-ii/">http://www.thegeekstuff.com[..]mand-with-10-examples-%E2%80%93-part-ii/</a> <br/><br/><script type="text/javascript"><!--google_ad_client = "pub-9426659565807829";google_ad_slot = "9359905831";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> 2016-02-03T14:01:03Z find.txt 2016-02-03T13:57:47Z 2016-02-03T13:57:47Z <br/>An question about how to remove unused package from MacOSX turn out to be an example of "find" command:<br/><br/><a href="http://forums.osxfaq.com/viewtopic.php?p=57887#57887">http://forums.osxfaq.com/viewtopic.php?p=57887#57887</a> <br/><a href="http://www.osxfaq.com/tips/unix-tricks/week98/tuesday.ws">http://www.osxfaq.com/tips/unix-tricks/week98/tuesday.ws</a> <br/><a href="http://javarevisited.blogspot.com/2011/03/10-find-command-in-unix-examples-basic.html">http://javarevisited.blogspot.com[..]find-command-in-unix-examples-basic.html</a> <br/><br/>File Search tips in Linux - <a href="http://discuss.joelonsoftware.com/default.asp?pg=pgDiscussThread&ixDiscussTopicParent=18272&ixDiscussGroup=3">http://discuss.joelonsoftware.com[..]iscussTopicParent=18272&ixDiscussGroup=3</a> <br/><br/>Another search tip, example of find base on time and size, and how to compare with other files - <a href="http://viralpatel.net/blogs/2010/02/some-useful-unix-file-finding-commands.html">http://viralpatel.net[..]e-useful-unix-file-finding-commands.html</a> <br/><br/>Like search by name, depth, size - <a href="http://www.thegeekstuff.com/2009/03/15-practical-linux-find-command-examples/">http://www.thegeekstuff.com[..]5-practical-linux-find-command-examples/</a> <br/><br/>use 'find' to delete branch of file: <a href="http://keithdevens.com/weblog/archive/2005/Jul/05/find.rm">http://keithdevens.com/weblog/archive/2005/Jul/05/find.rm</a> <br/><br/>By time - <a href="http://www.thegeekstuff.com/2009/06/15-practical-unix-linux-find-command-examples-part-2/">http://www.thegeekstuff.com[..]unix-linux-find-command-examples-part-2/</a> <br/><br/>Use of empty - <a href="http://www.thegeekstuff.com/2010/03/find-empty-directories-and-files/">http://www.thegeekstuff.com[..]010/03/find-empty-directories-and-files/</a> <br/><br/><script type="text/javascript"><!--google_ad_client = "pub-9426659565807829";google_ad_slot = "9359905831";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> 2016-02-03T13:57:47Z locate.txt 2016-02-03T13:55:53Z 2016-02-03T13:55:53Z <br/><a href="http://www.thegeekstuff.com/2012/03/locate-command-examples/">http://www.thegeekstuff.com/2012/03/locate-command-examples/</a> <br/><br/><script type="text/javascript"><!--google_ad_client = "pub-9426659565807829";google_ad_slot = "9359905831";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> 2016-02-03T13:55:53Z sed.txt 2015-08-21T02:01:52Z 2015-08-21T02:01:52Z <br/><a href="http://www.catonmat.net/blog/worlds-best-introduction-to-sed/">http://www.catonmat.net/blog/worlds-best-introduction-to-sed/</a> <br/><br/><a href="http://javarevisited.blogspot.com.au/2013/05/sed-command-examples-in-unix-and-linux.html">http://javarevisited.blogspot.com.au[..]-command-examples-in-unix-and-linux.html</a> <br/><br/><a href="http://www.markhneedham.com/blog/2015/08/13/sed-using-environment-variables/">http://www.markhneedham.com[..]5/08/13/sed-using-environment-variables/</a> <br/><br/><script type="text/javascript"><!--google_ad_client = "pub-9426659565807829";google_ad_slot = "9359905831";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> 2015-08-21T02:01:52Z pdf.txt 2013-03-01T01:25:37Z 2013-03-01T01:25:37Z <br/>Convert PDF to set of image as slide show - <a href="http://ejohn.org/blog/easy-pdf-sharing/">http://ejohn.org/blog/easy-pdf-sharing/</a> <br/><br/>pdftk, extra pages from one pdf to another pdf - <a href="http://linuxcommando.blogspot.com.au/2013/02/splitting-up-is-easy-for-pdf-file.html">http://linuxcommando.blogspot.com.au[..]2/splitting-up-is-easy-for-pdf-file.html</a> <br/><br/><script type="text/javascript"><!--google_ad_client = "pub-9426659565807829";google_ad_slot = "9359905831";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> 2013-03-01T01:25:37Z string.txt 2012-12-22T16:56:52Z 2012-12-22T16:56:52Z <br/><a href="http://www.thegeekstuff.com/2010/07/bash-string-manipulation">http://www.thegeekstuff.com/2010/07/bash-string-manipulation</a> <br/><br/><a href="http://www.thegeekstuff.com/2010/11/strings-command-examples/">http://www.thegeekstuff.com/2010/11/strings-command-examples/</a> <br/><br/><a href="http://www.thegeekstuff.com/2011/01/regular-expressions-in-grep-command/">http://www.thegeekstuff.com[..]/01/regular-expressions-in-grep-command/</a> <br/><br/>tr, useful string tranformation tool - <a href="http://www.thegeekstuff.com/2012/12/linux-tr-command/">http://www.thegeekstuff.com/2012/12/linux-tr-command/</a> <br/><br/><script type="text/javascript"><!--google_ad_client = "pub-9426659565807829";google_ad_slot = "9359905831";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> 2012-12-22T16:56:52Z xdotool.txt 2012-01-24T16:42:37Z 2012-01-24T16:42:37Z <br/>Simulate user input - <a href="http://pratyeka.org/fake-x-input/">http://pratyeka.org/fake-x-input/</a> <br/><br/><script type="text/javascript"><!--google_ad_client = "pub-9426659565807829";google_ad_slot = "9359905831";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> 2012-01-24T16:42:37Z sort.txt 2011-09-03T03:37:14Z 2011-09-03T03:37:14Z <br/>Sort by column - <a href="http://javarevisited.blogspot.com/2011/08/unix-sort-command-example-tutorial.html">http://javarevisited.blogspot.com[..]/unix-sort-command-example-tutorial.html</a> <br/><br/><script type="text/javascript"><!--google_ad_client = "pub-9426659565807829";google_ad_slot = "9359905831";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> 2011-09-03T03:37:14Z webserver.txt 2011-08-24T18:16:44Z 2011-08-24T18:16:44Z <br/>Create webserver with nc using bash<br/><br/><a href="http://www.linuxscrew.com/2007/09/06/web-server-on-bash-in-one-line/">http://www.linuxscrew.com[..]07/09/06/web-server-on-bash-in-one-line/</a> <br/><a href="http://paulbuchheit.blogspot.com/2007/04/webserver-in-bash.html">http://paulbuchheit.blogspot.com/2007/04/webserver-in-bash.html</a> <br/><br/><script type="text/javascript"><!--google_ad_client = "pub-9426659565807829";google_ad_slot = "9359905831";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> 2011-08-24T18:16:44Z loop.txt 2011-07-11T17:11:20Z 2011-07-11T17:11:20Z <br/><a href="http://www.thegeekstuff.com/2011/07/bash-for-loop-examples/">http://www.thegeekstuff.com/2011/07/bash-for-loop-examples/</a> <br/><br/><script type="text/javascript"><!--google_ad_client = "pub-9426659565807829";google_ad_slot = "9359905831";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> 2011-07-11T17:11:20Z useful example of shell script.txt 2011-07-07T15:54:28Z 2011-07-07T15:54:28Z <br/>xmlwf, need to know if a XML document is well formed? (A configuration file maybe..)<br/>mkfifo is the coolest one. Sure you know how to create a pipeline piping the output of grep to less or maybe even perl. <br/>nl, add number for every line of a file<br/><br/><a href="http://bashcurescancer.com/10-linux-commands-youve-never-used.html">http://bashcurescancer.com[..]/10-linux-commands-youve-never-used.html</a> <br/><br/><a href="http://www.thegeekstuff.com/2010/11/50-linux-commands/">http://www.thegeekstuff.com/2010/11/50-linux-commands/</a> <br/><br/>======================================create real player song list<br/>#!/bin/sh<br/>win_path=C:/tools<br/>linux_path=/mnt/disk/winapp<br/>for file in `find $1 -type f`;<br/>do<br/> if(`/bin/cat $file | grep $win_path`); then echo $file;fi;<br/>done;<br/>/usr/bin/find $MUSIC_SRC -type f -exec /bin/echo <a href="file://{}">file://{}</a> \; > $TMPDIR/tmp.rm <br/>while read i ; do /bin/echo "$RANDOM $i" ; done < $TMPDIR/tmp.rm | /bin/sort -n | /bin/sed 's/^[0-9]* //' > $TMPDIR/tmp1.rm<br/>/bin/cat $TMPDIR/tmp1.rm |/bin/sed -e 's/file:\/\///' >$HOME/mplayer.list<br/>/bin/cat $TMPDIR/tmp1.rm |/bin/grep -vi wma >$HOME/real.rm<br/>/bin/cat $TMPDIR/tmp1.rm |/bin/sed -e 's/file:\/\/\/var\/www\/html/http:\/\/www.carfield.com.hk/'>/var/www/html/.secure/media/music/live.rm<br/><br/>======================================remove log<br/>for file in `find -type f|grep website.|grep -v lck`;do rm -f $file;done<br/>======================================for loop<br/>for((a = 1; a <10; a++)); do wget -b "http://www.thai.net/ferrari545/bbs_series/ku_bbs_000$a.jpg";done <br/>======================================resize photo<br/>for i in *.jpg; do convert -geometry 1024x768 $i newdir/$i ; done<br/>======================================basic calculation<br/>i=1;find|grep -v zng|grep -v avi|while read file;do mv "$file" $i.jpg;i=$((i+1));done<br/>======================================# Make 3 a copy of 1 (stdout)<br/>exec 3>&1<br/>result="$(command to generate stream \<br/> | tee /dev/fd/3 \<br/> | command to process stream)"<br/># Now work with $result<br/># The original stream also went to the console<br/><br/><a href="http://binkley.blogspot.com/2007/05/getting-more-from-streams-in-bash.html">http://binkley.blogspot.com[..]5/getting-more-from-streams-in-bash.html</a> <br/><br/><br/><script type="text/javascript"><!--google_ad_client = "pub-9426659565807829";google_ad_slot = "9359905831";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> 2011-07-07T15:54:28Z test.txt 2009-02-11T10:55:55Z 2009-02-11T10:55:55Z <br/>hint of using test - <a href="http://www.ibm.com/developerworks/linux/library/l-bash-test.html">http://www.ibm.com/developerworks/linux/library/l-bash-test.html</a> <a href="http://binkley.blogspot.com/2009/02/speeding-up-cygwin-login.html">http://binkley.blogspot.com/2009/02/speeding-up-cygwin-login.html</a> <br/><br/><br/><script type="text/javascript"><!--google_ad_client = "pub-9426659565807829";google_ad_slot = "9359905831";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> 2009-02-11T10:55:55Z date.txt 2008-05-08T06:00:20Z 2008-05-08T06:00:20Z <br/>A working date calculation script<br/><br/><a href="http://www.unix.com/unix-dummies-questions-answers/4870-days-elapsed-between-2-dates.html">http://www.unix.com[..]s/4870-days-elapsed-between-2-dates.html</a> <br/><br/><script type="text/javascript"><!--google_ad_client = "pub-9426659565807829";google_ad_slot = "9359905831";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> 2008-05-08T06:00:20Z check exit status.txt 2006-06-16T13:37:41Z 2006-06-16T13:37:41Z <br/><br/>Need to check #? and PIPESTATUS<br/><br/><a href="http://www.mattryall.net/article.cgi?id=247">http://www.mattryall.net/article.cgi?id=247</a> <br/><br/><script type="text/javascript"><!--google_ad_client = "pub-9426659565807829";google_ad_slot = "9359905831";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> 2006-06-16T13:37:41Z Batch rename.txt 2006-05-28T10:31:46Z 2006-05-28T10:31:46Z <br/>Script of batch rename at unix system<br/><br/><a href="http://mattfleming.com/node/110">http://mattfleming.com/node/110</a> <br/><a href="http://stuart.woodward.jp/?p=279">http://stuart.woodward.jp/?p=279</a> <br/><br/><script type="text/javascript"><!--google_ad_client = "pub-9426659565807829";google_ad_slot = "9359905831";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> 2006-05-28T10:31:46Z Unix KornShell Quick Reference.txt 2005-11-08T06:33:09Z 2005-11-08T06:33:09Z <br/><a href="http://www.maththinking.com/boat/kornShell.html">http://www.maththinking.com/boat/kornShell.html</a> <br/><br/><script type="text/javascript"><!--google_ad_client = "pub-9426659565807829";google_ad_slot = "9359905831";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> 2005-11-08T06:33:09Z safer rm.txt 2005-10-04T03:58:05Z 2005-10-04T03:58:05Z <br/>A number of tips to make rm command safer <br/><br/><a href="http://www.macosxhints.com/article.php?story=20050928082624470&lsrc=osxh">http://www.macosxhints.com[..]le.php?story=20050928082624470&lsrc=osxh</a> <br/><br/><script type="text/javascript"><!--google_ad_client = "pub-9426659565807829";google_ad_slot = "9359905831";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> 2005-10-04T03:58:05Z