Run a command with a custom number of open files limit

prlimit

  • Get or set process resource soft and hard limits.
    Given a process ID and one or more resources, prlimit tries to retrieve and/or modify the limits.
    More information: <https://manned.org/prlimit>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

prlimit --nofile={{10}} {{command}}

click the source code to copy install prlimit on any operating system with command-not-found.com