快速ls命令 [英] Quick ls command
本文介绍了快速ls命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我必须得到一个包含大约200万个文件的目录列表,但是当我对它执行 ls
命令时,什么也没回来.我已经等了三个小时了.我试过 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屋!
查看全文