- Below are a few example commands. What does each do? Think about it first!
grep "^abc" $HOME/??
grep [Ss] dirtree/sdira/ssdir1/sbd1/file*
ls -lrt | sed -e 's/.*[ ]//' # That's a space and a tab inside the brackets.
- If you want to use a character without its special meaning in a regular expression, you must escape it with a back-slash. For instance, create a file1 with some lines with a * and try each of these commands and notice the difference:
grep * file1
grep '*' file1
grep \* file1
grep '\*' file1
- How can you get a file with a * in it?
- How can you get a filename with a * in it?