如何使用 bash 测试文件系统的目录限制

发布于 2024-10-04 06:14:49 字数 188 浏览 0 评论 0原文

我需要测试可以在文件系统(网络安装驱动器和本地(USB)驱动器)上创建多少目录和文件。我现在使用这个 bash 行:

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

我知道它可能可以做得更好,我想知道如何做。 (在bash中,不太复杂)

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)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

素食主义者 2024-10-11 06:14:49

任何文件/目录都使用 inode 表示,采用查看 df -i ,您应该大致了解可以创建/使用的文件/目录的数量。

Any file/directory is represented using an inode, take a look at df -i and you should get an overview of the number of files/directories you have the possiblity to create/use.

☆獨立☆ 2024-10-11 06:14:49
while (true); do
  mkdir a
  cd a
done

创建类似 ./a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/ 的内容一个/...

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/...

把回忆走一遍 2024-10-11 06:14:49

cd方法实际上工作得更好更快...我的ext4 USB棒开始模拟大约1040个文件夹...

网络部分是测试我的wins2k3配置,但我的virtualbox此刻失败了,因为我认为我搞砸了一些东西...

The cd method actually works better and faster... My ext4 usb stick starts to mock at about 1040 folders...

And the network part is to test my wins2k3 config, but my virtualbox fails at the moment because I think I screwed something up...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文