a.*le
and a line that matches the regular expression ba.*na
. $ grep -rli 'a.*le' | xargs -d '\n' grep -li 'ba.*na'
a.*le
. The file names of these files is then piped into xargs
to search for ba.*na
. xargs
is given the -d
option to delimit incoming file nams on the new line rather than spaces because the first part might return directory or file names with spaces.