Using awk in Alias Command - CentOS & Red Hat

Its possible to use awk in Alias command. I did that by simply just modifying some parenthesis and there you go, had a working awk command.

All that it required was closing awk in double quotes as opposed to single quotes and forward slash before the "$" variable. This alias command is for printing the default Gateway for an interface.

 alias eth0-gw='route -n | grep eth0 | awk "NR==1{ print \$2 }"'

Linux Related Articles . . .

To generate a SHA256 certficate in linux all you need to do is run this openssl command and you will...
This a very useful One liner command to insert IP and hostname into /etc/hosts file and is particularly useful when...
Its possible to use awk in Alias command. I did that by simply just modifying some parenthesis and there you...
Its possible to run a script via Alias command. All you need is to modify the .bashrc and then source...
This article will guide you on creating a custom Self-signed SSL Certificate in no time. For creating one you would...