Question: Part 4 -Finding File Contents The grep command searches the contents of a file for lines that contain a certain pattern. Examples: -grep user/etc/passwd Display
Part 4 -Finding File Contents The grep command searches the contents of a file for lines that contain a certain pattern. Examples: -grep user/etc/passwd Display the lines from the file/etc/passwd that contain the string user. -grep -v user/etc/passwd Display the lines from the file /etc/passwd that do not contain the string user. -grep n root/etc/passwd Display line numbers and the lines from the file/etc/passwd that contain the string root. -grep ^u/etc/passwd Display the lines from the file /etc/passwd that start with u. -grep t\$/etc/passwd Display the lines from the file /etc/passwd that end with t. 1. Use the grep command to display your username from the file letc/passwd . 2. Use the grep command to display the lines from the file /etc/hosts.deny that are NOT comment lines (the comment lines are the lines that start with \#). When you are done, hi-light your answers in YELLOW and submit this document to SLATE
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
