Linux command 20/02/2014

Count number of specific character per line (our example number of tabulation)

cat file | tr -d -c '\t\n'| awk '{ print length; }'> stat

Extract strings that match a regular expression (our case string that begin with XXX and contain 9 characters)

cat input | egrep -oh 'XXX......' > output

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.