Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

LINUX please. Using the regular expression rules create grep commands that locat

ID: 3722918 • Letter: L

Question

LINUX please.

Using the regular expression rules create grep commands that locate the following lines in /etc/services:

All lines that contain the string smtp.

All lines that begin with the string smtp.

All lines that include periods (dots, .)

All lines that include the string ftp except when that string is followed immediately by a dash (-).

All lines in which the letter a follows the letter z.

All lines that include the string https or http-, but not those that include http followed by any other character.

All lines that end with a hash mark (#)

You may need to enclose some of the regular expressions required to accomplish these tasks in quotes, as in grep "IANA" /etc/services.

Explanation / Answer

grep -i "smtp" file.name // to find lines that contain the string smtp. include your filename in file.name $ grep -v 'smtp' file.name // lines beginning with smtp grep -i "." file.name//for dots $ grep -v 'smtp-' file.name//for string followed by dash $ grep -v 'az' file.name grep "[;]" file.name