快速 ls 命令 [英] Quick ls command

查看:13
本文介绍了快速 ls 命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须得到一个包含大约 200 万个文件的目录列表,但是当我对它执行 ls 命令时,什么都没有返回.我等了3个小时.我试过 ls |tee directory.txt,但这似乎永远挂起.

I've got to get a directory listing that contains about 2 million files, but when I do an ls command on it nothing comes back. I've waited 3 hours. I've tried ls | tee directory.txt, but that seems to hang forever.

我假设服务器正在进行大量的 inode 排序.有什么方法可以加快 ls 命令以获取文件名的目录列表?我现在不关心大小、日期、权限等.

I assume the server is doing a lot of inode sorting. Is there any way to speed up the ls command to just get a directory listing of filenames? I don't care about size, dates, permission or the like at this time.

推荐答案

ls -U

将执行 ls 而不进行排序.

will do the ls without sorting.

这篇关于快速 ls 命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆