Basic Linux TutorialIntroduction – What is it? Why to learn? Linux installation directory structures Boot process Run levels in Linux Desktop Environments Different shells BASH Internal and External Commands Basic Linux Commands Important files and directories in Linux Environmental and Shell Variables Command history in Linux Character classes in Linux Text editors vim nano Searching files Creating new files Viewing File Contents File commands File permissions and ownership WildCards (Globbing) in files File compression Directory commands xargs command in Linux Comparing files Searching patterns using grep command Translating the characters using tr command Extracting data using cut command Stream editing using sed command Data extraction and reporting using awk command Sorting the file or string input uniq command in Linux Difference between grep, tr, cut, sed and awk commands Hardware commands Hard disk and memory space commands Working with Processes Managing Jobs Working with cron jobs Service command in Linux Network commands Managing Users and Groups Other Popular commands Standard streams and Redirection Pipes Package Managers in Linux
difference between grep, sed, awk in linux shell
- 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
Complex problems, Simple Solutions