Count total lines of file, use {{{ wc -l filename wc -l filename | sed -n 's/^s*([0-9]*)[^0-9]*/1/p' }}} the second command displays only the total number of lines in the file called //filename//. see more detail about //wc//, type //man wc//. The following command works on Mac. {{{ wc -l filename | sed -n 's/^[ ]*([0-9]*)[^0-9]*/1/p' }}} Reject all connection from outside world: {{{ iptables -A INPUT -i eth0 -p tcp --dport 80 -j REJECT }}} One line loop command {{{ for i in $(seq 1 2 10); do echo $i; done }}} For better sorting, rename all files with one digit number to two digits number, ex. rename //a_1.dat// to //abaceda_01.dat// {{{ rename 's/(w+?)_(d).dat/$1_0$2.dat/' files }}} Changing PDF Metadata on Ubuntu, see [[]] *install program pdftk {{{ sudo apt-get install pdftk }}} *dump metadata into a file, say report.txt {{{ pdftk book.pdf dump_data output report.txt }}} *edit the report.txt by any texteditor, The text file will contain key value pairs like: {{{ InfoKey: Title InfoValue: Coders At Work InfoKey: Author InfoValue: Peter Seivel InfoKey: Subject InfoValue: Programming }}} *update the metadata into the file {{{ pdftk book.pdf update_info report.txt output bookcopy.pdf }}} Sort and remove duplicate line in text file {{{ sort input-filename | uniq -i -u >output-filename }}} See more about [[|Regular expression]], about [[|iptables]]