So I'm creating a simple grep command that gets only the last logged in people who's username starts with 161 and has 3 digits next to it:
last | grep "^161[0-9]{3}"
However it doesn't print anything even though it has these usernames on the list. Whats even more weirder is if I do egrep instead of grep
last | egrep "^161[0-9]{3}"
The command works.
Can anyone explain what is the difference?
161444
, it would also match1614444444444444
. – Kusalananda Jun 02 '18 at 08:09