Apr 2, 2020

awk command in unix

What is AWK?
It is a scripting language and considered the most powerful command in the Linux environment. It does not require any compiling and generates reports by processing some files and then analyze those files. It is used to manipulate data and is thus suitable for pattern searching and processing.

Source: awk_link

cat file | awk '{ print NF}' - to check how many columns are there in the file
the NF variable, which will give you the number of fields

No comments:

Post a Comment