Filtering Input
Grep ( The Weapon) The grep command is a text filter that will search input and return lines, which contain a match to a given pattern. grep [ OPTIONS ] PATTERN [ FILE ] Follow Along Use the following command to switch to the Documents directory: sysadmin@localhost : ~ $ cd ~/Documents If the example below fails, repeat the example from Section 11: sysadmin@localhost : ~/Documents $ cp /etc/passwd . For example, the passwd file we previously copied into the Documents directory contains the details of special system accounts and user accounts on the system. This file can be very large, however the grep command can be used filter out information about a specific user, like the sysadmin user. Use sysadmin as the pattern argument and passwd as the file argument: sysadmin@localhost : ~/Documents $ grep sysadmin passwd sysadmin :x:1001:1001:System Admi...