Write a command to find out how many users in etcpasswd have
Write a command to find out how many users in /etc/passwd have the last name “Harris” but not “Harrison” or anything added to the end of “Harris”. (unix/linux)
Solution
By using erep command we can find out how many users in /etc/passwd. Here we are going to check whether there exists any user having the last name “Harris” but not \"Harrison\"
egrep -i \"^Harris\" && ~\"^Harrison\" /etc/passwd
