I moved away from Ubuntu to Debian, and having a problem with my find
now for searching tex files for the word masi.
Code and its output
masi@masi:~$ find -L "/home/masi/" -xtype f \
-name "*.tex" -exec fgrep -l 'masi' {} + /dev/null
find: paths must precede expression: /dev/null
Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]
/dev/null
is necessary in the second command set because we are usingfind -L
, since we want to include all symlinks and go them through and not exclude anything in the search. Thread where the motivation for the use here about How to Avoid Many Levels of symlinks with this find?
As one-liner
find -L "/home/masi/" -xtype f -name "*.tex" -exec fgrep -l 'masi' {} + /dev/null
OS: Debian 8.5
Linux kernel: 4.6 of backports
Hardware: Asus Zenbook UX303UA
Related: find
command of my haetex
script in the thread How to search .tex files?
Find: find (GNU findutils) 4.4.2
Fgrep: grep (GNU grep) 2.20
/dev/null
in the end supposed to mean?fgrep
invocation is missing the search string. Should be something likefgrep -l 'some string' {} +
. I can't understand what the/dev/null
is supposed to do here.2>/dev/null
in the end to hide stderr messages.