Indiana University
University Information Technology Services
  
What are archived documents?

What is awk, and how do I use it?

At Indiana University, you can use awk on all the Unix-based central systems. Although awk is a complete pattern scanning and processing language, it is most commonly used as a Unix command-line filter to reformat the output of other commands. For example, to print only the second and sixth fields of the date command (the month and year) with a space separating them, at the Unix prompt, you would enter:

date | awk '{print $2 " " $6}'

To read the online manual (the man page) for awk, at the Unix prompt, enter:

man awk

Also, consult the newsgroup comp.lang.awk.

gawk is a version of awk produced by the GNU Project. At IU, it is available on Quarry in the /usr/bin/gawk directory, and on Libra in the /opt/freeware/bin/gawk directory.

For information about gawk, at the Unix prompt, enter:

man gawk

Also see:

This is document afja in domain all.
Last modified on April 29, 2008.
Please tell us, did you find the answer to your question?