NSAS Wiki

Network System Access Solutions

User Tools

Site Tools


Sidebar

Contact

linux:awk

AWK examples

using a delimiter

grep -i 'memtotal' /proc/meminfo | awk -F':' '{ print $2}'

Find the same files by their size:

ls -l | awk '$1!~/^d/{if(size[$5]!=""){ print}size[$5]=$8}'

greps everything in between

awk '/Dec 17 16:35:17/,/Dec 17 17:55:17/' /var/log/syslog

summing

cat list | awk -F, '{sum+=$1} END{print sum}'
linux/awk.txt · Last modified: 2014/01/23 13:52 by michel.pelzer