Chapter 5: Text, editors and the shell environment
grep, vim and Bash quiz
Twelve questions across the whole chapter. Each answer explains why. Aim for nine before moving on to chapter 6.
- Which sends both output and errors of a command into one file, all.log?
- What does cmd 2> /dev/null | wc -l count?
- Why is cmd 2>&1 > file different from cmd > file 2>&1?
- Which grep pattern matches lines that start with a digit?
- Which command shows lines of app.conf that are neither comments nor empty?
- In basic grep syntax, how do you match one or more digits?
- You are in vim and typed text in the wrong place. Which keys undo it?
- Which vim command saves and quits?
- Which vim keys delete three lines?
- Why does a command you put in ~/bin run without typing its full path?
- Where would you set an environment variable for every user on the system?
- What does LANG=C ls run?