I can't seem to recursively search with grep for some reason in WSL2.
me@SOMEHOST:~$ grep -r -e "DATASTORE_BAKs" --exclude=SOMEHOST-2\.viminfo *
grep: SOMEHOST-2.viminfo: invalid context length argument
It seems to have something to do with my .viminfo
file, but I can't exclude it properly and I can't even ignore the file using the ignore binary arg.
The file seems to contain alot of --
characters and I'm wondering if that's screwing it up.
I also did a file
command on it and it doesn't warrant much:
le ./.viminfo
./.viminfo: data
How can I make this work again?
grep -r -e "DATASTORE_BAKs" --exclude=SOMEHOST-2\.viminfo -- *
? It's more likely that you have a file named something like-ASOMEHOST-2\.viminfo
or-CSOMEHOST-2\.viminfo
in the current directory.
instead of*
?-
. See for example What does "--" (double-dash) mean?.
instead of*
(unless your intent is to skip hidden files/directories in the current directory?)