Listing email alias & user from /etc/aliases on Linux

You may try this code should you want to list the email address from /etc/aliases

cat /etc/aliases | grep -w $1 | awk -F: ‘{print $1}’

Output:
jepdante@yahoo.com

or email and user

cat /etc/aliases | grep -w $1 | awk ‘{print $1,$2}’

Output:
jepdante@yahoo.com: jepdan03

Advertisements

Mag-iwan ng Tugon

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Baguhin )

Twitter picture

You are commenting using your Twitter account. Log Out / Baguhin )

Facebook photo

You are commenting using your Facebook account. Log Out / Baguhin )

Google+ photo

You are commenting using your Google+ account. Log Out / Baguhin )

Connecting to %s