Chapter 5: Text, editors and the shell environment
Send command output where you want it, search text with grep, edit files with vim, and set up your shell with variables, aliases and startup files.
What you will learn
- Redirect standard output and standard error to files, discard them, and connect commands with pipes and tee.
- Search files and command output with grep and regular expressions.
- Create and edit text files with vim.
- Use shell and environment variables, PATH and aliases, and make them permanent in Bash's startup files.
Sections
- Redirection and pipes
- Exercise: Capture and combine output
- Search text with grep
- Exercise: Answer questions with grep
- Edit files with vim
- Exercise: Create and edit a file with vim
- Variables, aliases and startup files
- Exercise: Customise your shell
- Exercise: Text and environment review
- grep, vim and Bash quiz
- grep, vim and Bash cheat sheet