GNU egrep does not support the \d shorthand

I learnt this the hard way (and said hello to a large living world of non-standard regex implementations). The GNU grep/egrep documentation page documents all their special backslash character support but \d is not one of them.

That is, the following will not work when trying to match a numeric digit at the beginning of file (for example):

egrep '^\d' file.log

You need to use either of these two alternative forms instead:

egrep '^[:digit:]' file.log (OR,)
egrep '^[0-9]' file.log

Checking out a git branch when multiple remotes (repos) are involved

When you are dealing with a local git repository which has multiple remotes defined (i.e. has multiple remote repositories possibly carrying the same branches, such as multiple forks), then the right way to checkout a working branch from one of them is to use the below syntax:

git checkout -b master origin/master

Where origin is the name of the remote.

You can also delete a local branch before switching to another repository’s copy of it:

git checkout origin/master
git branch -D master
git checkout -b master origin/master