Today I wanted to learn why one of my systems has EDITOR set and another not. To avoid having to think hard I did what was more convenient: A full-system full-text search. Unfortunately this failed to find the relevant file /etc/environment.
This command does not find it:
$ cd /
$ ag 'EDITOR' / 2>/dev/null -l | grep etc
$ # no output
However, this command does find it:
$ cd /
$ ag 'EDITOR' /etc 2>/dev/null -l | grep etc
/etc/environment
/etc/mail.rc
/etc/neomuttrc
/etc/texmf/xdvi/XDvi
I'd like to better understand this behaviour! Why is ag ignoring /etc?