Basic Commands
and Simple Shell Scripts82
We have now concatenated two pipes, one to filter the output and another to count it. We will find ourselves doing this kind of plumbing often when searching for and finding information in the system.
Some very common options
for grep areas follows -i for ignore-case. This will match the pattern whether it’s uppercase, lowercase, or
a combination thereof -v for invert match. This will show all entries that do not match the pattern being searched for -r for
recursive. We can tell grep to search fora pattern in all the files within a directory while going through all of them (if we have permission).
There is also away to also filter columns in the output provided. Let’s say we have a list of files in our home directory and we want to see its size. We run the following command:
Share with your friends: