0

I setup a 16.04 ubuntu webserver through AWS. After installing some programs now when I connect with putty it will not take any commands and after 20 seconds it starts repeatedly throwing the following errors-

-bash: /usr/bin/lesspipe: Argument list too long

-bash: /usr/bin/dircolors: Argument list too long

I can stop it with ctrlc and I can change directories but that's it. Any suggestions to figure out whats causing this error? Sorry I'm relatively new to linux.

5
  • 1
    Seems like something bad got added to your shell files. Could you check your .bashrc and .profile files in your home folder? – Byte Commander Jul 22 '18 at 23:29
  • Check for ^M at the end of lines - Unix/Linux uses ^J, Windows uses ^M^J. – waltinator Jul 22 '18 at 23:45
  • I've been following this setup guide to play around with open source crypto mining pool. github.com/ToastPool/yiimp#then-configure-the-web-app Where I ran into this is after i almost completed the "configure and run Sia stratum server" – fluxman Jul 22 '18 at 23:49
  • 2
    Those instructions appear to suggest (or could be interpreted to suggest) adding source ~/.bashrc to your ~/.bashrc - this will make bash recursively source the file for ever. – steeldriver Jul 22 '18 at 23:52
  • Check what getconf ARG_MAX says. Your ARG_MAX value may be set too low, potentially in the /etc/limits.conf` file by the admin. For current shell you could work around it with ulimit -s <bytes> , just need to know how much to set. A double what ulimit -s reports could be a start – Sergiy Kolodyazhnyy Jul 23 '18 at 0:47
4

The instructions you linked say

add the following to your ~/.bashrc

export GOPATH=$HOME/.go 
export PATH=$PATH:/usr/lib/go-1.10/bin:$GOPATH/bin

source ~/.bashrc

What the author presumably intended was

add the following to your ~/.bashrc

export GOPATH=$HOME/.go
export PATH=$PATH:/usr/lib/go-1.10/bin:$GOPATH/bin

and then execute the command

source ~/.bashrc

If you actually add the line source ~/.bashrc to ~/.bashrc, then bash will hang for ever while it recursively sources the file - likely this is also what's causing the argument list too long errors as it will repeatedly add arguments to lesspipe and dircolors

To fix it you will need to edit ~/.bashrc and remove the source ~/.bashrc line.

0
1

Emmmmm just got the same error and fixed it.

First, echo $PATH in the command line then you got a long output of your environment variable. Copy part of it you really needed.

export PATH= + the path you copied.

Then everything is worked!

Don't forget to delete source ~/.bashrc at the end of .bashrc.

1
  • I had to ctrl-c the source as fast as possible so that I was not kicked out. After export PATH= to include just the typical paths I was able to modify .bash_profile and re-source it without a problem – Kwame Apr 23 at 18:50
0

All the above suggestions didn't work for me, the solution that I found helpful is here, Actually I screwed up my .bashrc file and then no command was working (ls, vi, rm, mv, literally nothing was working). Some people suggested to call vi editor using full path /usr/bin/vi ~/.bashrc, this was also not working for me. The solution that worked for me is to access your .bashrc file via the file browser.

Open the file browser, go to the home directory, press Ctrl+H so that hidden files are shown. Edit .bashrc as needed

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.