Linux grep option -e

What is linux grep option -e

The -e option is used to search for “or”.
Let’s look at example below.

command

sudo cat cron | grep 'Jan 12 11:0[0-9]' | grep -e run-parts -e anacron
[vagrant@localhost log]$ sudo cat cron | grep 'Jan 12 11:0[0-9]' | grep -e run-parts -e anacron
Jan 12 11:01:01 localhost CROND[8441]: (root) CMD (run-parts /etc/cron.hourly)
Jan 12 11:01:01 localhost run-parts(/etc/cron.hourly)[8441]: starting 0anacron
Jan 12 11:01:01 localhost anacron[8450]: Anacron started on 2019-01-12
Jan 12 11:01:01 localhost run-parts(/etc/cron.hourly)[8452]: finished 0anacron
Jan 12 11:01:01 localhost anacron[8450]: Will run job `cron.daily' in 7 min.
Jan 12 11:01:01 localhost anacron[8450]: Jobs will be executed sequentially
Jan 12 11:08:01 localhost anacron[8450]: Job `cron.daily' started
Jan 12 11:08:01 localhost run-parts(/etc/cron.daily)[8453]: starting logrotate
Jan 12 11:08:01 localhost run-parts(/etc/cron.daily)[8461]: finished logrotate
Jan 12 11:08:01 localhost run-parts(/etc/cron.daily)[8453]: starting makewhatis.cron
Jan 12 11:08:03 localhost run-parts(/etc/cron.daily)[8585]: finished makewhatis.cron
Jan 12 11:08:03 localhost anacron[8450]: Job `cron.daily' terminated
Jan 12 11:08:03 localhost anacron[8450]: Normal exit (1 job run)