We have a slight misunderstanding. I was speaking of the carets in the three regular expressions a little further down. The regular expressions that you use to select which files to delete. They
need to be written without the caret as the text that you want to match is not at the start of the line.
In the grep statement you do need the caret. You need it because you want to exclude files that start with a fullstop (you probably call it a period). So, in the case of the grep you want to match:
- Start of line
- Followed by a fullstop
- Followed by anything at all
This is different from later on when you want to match:
- Anything at all. It might be start of line, it might not.
- Followed by a fullstop. This might be just after the start of line. Then again, it might be a few characters further along the string being matched against.
- Followed by the letter l, then the letter o, then the letter g.
Do you see the difference ?