2

While trying to run certain commands via ubuntu terminal, I receives an error message

Failed to execute process '/bin/grep'. Reason:
The total size of the argument and environment lists 1.8MB exceeds the operating system limit of 2MB.
Try running the command again with fewer arguments.

The above error occured while I was trying to grep a string inside a folder via terminal.

I am using fish shell, with ubuntu 18.04 lts. Has 7.7 GiB RAM. OS type 64bit. GNOME 3.28.2 and has disk space with 34% used.

sarathkm
  • 151
  • 1
  • 4
  • Maybe related to this link: https://codeyarns.com/2017/03/07/size-of-argument-and-environment-lists-exceeds-limit/ You could try combine with find command so the argument will not be a huge list. – Alvin Liang Nov 11 '19 at 06:29
  • Though I think this is potentially answerable as it stands, I recommend that you [edit] with the exact command you ran that produced the error. Then answers could explain the specific reason for the problem and how to work around it. Argument list too long when copying files covers the general reason for this sort of error, but especially considering you're using fish--and that you're using grep, which offers fine-grained control during recursive operation--I suspect this shouldn't be considered a duplicate of that. – Eliah Kagan Nov 12 '19 at 18:32

1 Answers1

0

Incorrectly setting PATH environment variable might cause this error.

You should NOT add this line to config.fish. If you do, the variable will get longer each time you run fish!

See issue