Difference between grep, tr, cut, sed and awk commands
- grep can only shows the lines matching pattern. You can not transform the output.
- tr command is used to replace the characters with other set of characters. Remember that sed works at pattern level.
- cut command is used to extract characters, fields from a file. We can also specify the delimiter that separate the columns. Even though we can achieve same thing using sed command, it is recommended to use cut command for simplicity.
- sed command is super set of grep, tr and cut command. Additionally it can transform output. sed is mainly used for extraction and substitution.
- awk is a super set of sed. awk supports programming. awk is mainly used when the data is in the table format. It also allows to delete matching lines
We can use programming constructs like for loop and conditions