Name:Regular Expressions

I'm using awk mostly for one thing- selecting individual columns in a file and write them into a new one- without having to open the file and read all elements. So here is the awk syntax;

awk '{print $1,$13}' oldfile > newfile

it writes column 1 and column 13 of oldfile into newfile


In case you want to substitute expressions:

 awk '{gsub(/UNIX/, "Linux"); print}' oldfile > newfile

here you substitute 'UNIX' in oldfile by 'LINUX' in newfile