Indiana University
University Information Technology Services
  
What are archived documents?
Login>>
Login

Login is for authorized groups (e.g., UITS, OVPIT, and TCC) that need access to specialized Knowledge Base documents. Otherwise, simply use the Knowledge Base without logging in.

Close

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 the Research Database Complex (RDC) in the /opt/freeware/bin/gawk directory.

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

man gawk

At Indiana University, for personal or departmental Linux or Unix systems support, see At IU, how do I get support for Linux or Unix?

This is document afja in domain all.
Last modified on June 30, 2009.

Comments/Questions/Corrections

Use this form to offer suggestions, corrections, and additions to the Knowledge Base. We welcome your input!

If you are affiliated with Indiana University and would like assistance with a specific computing problem, please use the Ask a Consultant form, or contact your campus Support Center.

Contact Information

Note: We will reply to your comment at this address. If your message concerns a problem receiving email, please enter an alternate email address.