How To Install gawk on CentOS 8

gawk is The GNU version of the AWK text processing utility The GNU version of the AWK text processing utility

Introduction

In this tutorial we learn how to install gawk on CentOS 8.

What is gawk

The gawk package contains the GNU version of AWK text processing utility. AWK is a programming language designed for text processing and typically used as a data extraction and reporting tool. The gawk utility can be used to do quick and easy text pattern matching, extracting or reformatting. It is considered to be a standard Linux tool for text processing. gawk 4.2.1 2.el8 x86_64 1.1 M gawk-4.2.1-2.el8.src.rpm baseos The GNU version of the AWK text processing utility https GPLv3+ and GPLv2+ and LGPLv2+ and BSD The gawk package contains the GNU version of AWK text processing utility. AWK is a programming language designed for text processing and typically used as a data extraction and reporting tool. The gawk utility can be used to do quick and easy text pattern matching, extracting or reformatting. It is considered to be a standard Linux tool for text processing.

We can use yum or dnf to install gawk on CentOS 8. In this tutorial we discuss both methods but you only need to choose one of method to install gawk.

Install gawk on CentOS 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install gawk using dnf by running the following command:

sudo dnf -y install gawk

Install gawk on CentOS 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install gawk using yum by running the following command:

sudo yum -y install gawk

How To Uninstall gawk on CentOS 8

To uninstall only the gawk package we can use the following command:

sudo dnf remove gawk

gawk Package Contents on CentOS 8

/etc/profile.d/gawk.csh
/etc/profile.d/gawk.sh
/usr/bin/awk
/usr/bin/gawk
/usr/lib/.build-id
/usr/lib/.build-id/0a
/usr/lib/.build-id/0a/b10d62196e8eecab3f90c6c8a90ed31901b4d6
/usr/lib/.build-id/13
/usr/lib/.build-id/13/f70d74477ac72509051748160f4925f9a0e185
/usr/lib/.build-id/14
/usr/lib/.build-id/14/e0dab2f4c96658463ef0e008fec4ca81d8c3ee
/usr/lib/.build-id/15
/usr/lib/.build-id/15/8bb7302f8be93f8428563a5148fc68ade18736
/usr/lib/.build-id/16
/usr/lib/.build-id/16/cee67e11fc0248e993676de1f291e581be7cf8
/usr/lib/.build-id/4e
/usr/lib/.build-id/4e/6f0b52e60ff017aa6e52786ca2a54e23c67a42
/usr/lib/.build-id/4e/a40d13404870516f48b12683fa783521fa70a1
/usr/lib/.build-id/61
/usr/lib/.build-id/61/095202e3134e4ab3f125ec08f2ce62edb97864
/usr/lib/.build-id/67
/usr/lib/.build-id/67/4db80e7e7819f9efca911b87fd02f304d69311
/usr/lib/.build-id/7b
/usr/lib/.build-id/7b/563f3f6d1a3047fad6b3c3379c9bd4d87cfdba
/usr/lib/.build-id/97
/usr/lib/.build-id/97/d91499173258d73ac546c45af5a68b1972ff31
/usr/lib/.build-id/ba
/usr/lib/.build-id/ba/2d43efb08570be180de90df3ec3bc77761a6c1
/usr/lib/.build-id/c8
/usr/lib/.build-id/c8/9352faea5ffc60bafc23a3ad363b3190cb7bc8
/usr/lib/.build-id/e6
/usr/lib/.build-id/e6/41f091079f401161de72346bd4c3b42ff4768d
/usr/lib/.build-id/ff
/usr/lib/.build-id/ff/00031fee3f03b8113127b04f25a9fb2ced1b3d
/usr/lib64/gawk
/usr/lib64/gawk/filefuncs.so
/usr/lib64/gawk/fnmatch.so
/usr/lib64/gawk/fork.so
/usr/lib64/gawk/inplace.so
/usr/lib64/gawk/intdiv.so
/usr/lib64/gawk/ordchr.so
/usr/lib64/gawk/readdir.so
/usr/lib64/gawk/readfile.so
/usr/lib64/gawk/revoutput.so
/usr/lib64/gawk/revtwoway.so
/usr/lib64/gawk/rwarray.so
/usr/lib64/gawk/time.so
/usr/libexec/awk
/usr/libexec/awk/grcat
/usr/libexec/awk/pwcat
/usr/libexec/gawk
/usr/share/awk
/usr/share/awk/assert.awk
/usr/share/awk/bits2str.awk
/usr/share/awk/cliff_rand.awk
/usr/share/awk/ctime.awk
/usr/share/awk/ftrans.awk
/usr/share/awk/getopt.awk
/usr/share/awk/gettime.awk
/usr/share/awk/group.awk
/usr/share/awk/have_mpfr.awk
/usr/share/awk/inplace.awk
/usr/share/awk/intdiv0.awk
/usr/share/awk/join.awk
/usr/share/awk/libintl.awk
/usr/share/awk/noassign.awk
/usr/share/awk/ord.awk
/usr/share/awk/passwd.awk
/usr/share/awk/processarray.awk
/usr/share/awk/quicksort.awk
/usr/share/awk/readable.awk
/usr/share/awk/readfile.awk
/usr/share/awk/rewind.awk
/usr/share/awk/round.awk
/usr/share/awk/shellquote.awk
/usr/share/awk/strtonum.awk
/usr/share/awk/walkarray.awk
/usr/share/awk/zerofile.awk
/usr/share/doc/gawk
/usr/share/doc/gawk/NEWS
/usr/share/doc/gawk/POSIX.STD
/usr/share/doc/gawk/README
/usr/share/doc/gawk/README.multibyte
/usr/share/gawk
/usr/share/info/gawk.info.gz
/usr/share/info/gawkinet.info.gz
/usr/share/info/gawkworkflow.info.gz
/usr/share/licenses/gawk
/usr/share/licenses/gawk/COPYING
/usr/share/licenses/gawk/LICENSE.BSD
/usr/share/licenses/gawk/LICENSE.GPLv2
/usr/share/licenses/gawk/LICENSE.LGPLv2
/usr/share/locale/ca/LC_MESSAGES/gawk.mo
/usr/share/locale/da/LC_MESSAGES/gawk.mo
/usr/share/locale/de/LC_MESSAGES/gawk.mo
/usr/share/locale/es/LC_MESSAGES/gawk.mo
/usr/share/locale/fi/LC_MESSAGES/gawk.mo
/usr/share/locale/fr/LC_MESSAGES/gawk.mo
/usr/share/locale/id/LC_MESSAGES/gawk.mo
/usr/share/locale/it/LC_MESSAGES/gawk.mo
/usr/share/locale/ja/LC_MESSAGES/gawk.mo
/usr/share/locale/ms/LC_MESSAGES/gawk.mo
/usr/share/locale/nl/LC_MESSAGES/gawk.mo
/usr/share/locale/pl/LC_MESSAGES/gawk.mo
/usr/share/locale/pt_BR/LC_MESSAGES/gawk.mo
/usr/share/locale/sv/LC_MESSAGES/gawk.mo
/usr/share/locale/vi/LC_MESSAGES/gawk.mo
/usr/share/locale/zh_CN/LC_MESSAGES/gawk.mo
/usr/share/man/man1/awk.1.gz
/usr/share/man/man1/gawk.1.gz
/usr/share/man/man3/filefuncs.3am.gz
/usr/share/man/man3/fnmatch.3am.gz
/usr/share/man/man3/fork.3am.gz
/usr/share/man/man3/inplace.3am.gz
/usr/share/man/man3/ordchr.3am.gz
/usr/share/man/man3/readdir.3am.gz
/usr/share/man/man3/readfile.3am.gz
/usr/share/man/man3/revoutput.3am.gz
/usr/share/man/man3/revtwoway.3am.gz
/usr/share/man/man3/rwarray.3am.gz
/usr/share/man/man3/time.3am.gz

References

Summary

In this tutorial we learn how to install gawk on CentOS 8 using yum and dnf.