bashmkdirlimits

How to use bash to test directory limits of filesystem


I need to test how many directories and files I can create on a filesystem (network mounted and local (usb) drives). I now use this bash line:

for i in {0..999999}; do mkdir -p $i; pushd $i; done

I know that it probably can be done better and I'd like to know how to. (in bash, not too complicated)


Solution

  • while (true); do
      mkdir a
      cd a
    done
    

    Creates something like ./a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/...