User Tools

Site Tools


bash:troubleshooting

BASH - Troubleshooting

Argument list too long

Example:

rm *.txt
bash: /usr/bin/rm: Argument list too long

Solution:

find . -name '.txt' -type f -delete

NOTE: Argument list too long indicates when a user feeds too many arguments into a single command which hits the ARG_MAX limit.

  • The ARG_MAX defines the maximum length of arguments to the exec function.
  • This limit for the length of a command is imposed by the operating system.
    • You can check the limit for maximum arguments on your Linux system using this command:
      getconf ARG_MAX
    • Which will return something like this:
      root@server1:~# getconf ARG_MAX
      2097152
bash/troubleshooting.txt · Last modified: 2022/09/18 12:04 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki