I am entering this world of regular expressions, I am with a doubt, I read about the metacharacters, etc. Well, I'm trying to validate a zip code and I'm using the following command and I'm not getting it ... I've already replaced \ d with [0-9] and I succeeded, but I can not do that:
cat arquivo.txt | grep -E '^\d{5}[-]\d{3}'
The .txt file has the line: 02954-852
Thank you.