在控制台下,如果想只列出当前文件夹下的目录,只要:
-d 属性只列出目录名称,而不列出目录中的内容,目录在控制台下的显示都以 “/“ 为结尾,所有的目录即为 “*/” 了。
当然,你也规定条件,比如,只列出 b 开头的目录:
如果你想列出隐藏目录:
如果你想统计目录数目,把结果传给 wc 即可:
剩下的大家自由发挥吧……
转自:
http://linux.byexamples.com/archives/314/how-to-list-just-directories-the-correct-way/
is-Programmer 是一个面向 Linux 爱好者与程序员的 Blog 系统,具有简洁的风格,方便的代码高亮和数学公式插入功能,适合撰写学习笔记和技术文档。
Host by is-Programmer.com | Power by Chito 1.3.3 beta
2022年6月21日 15:58
I wanted to thank you for this excellent read!! I definitely loved every little bit of it. I have you bookmarked your site to check out the new stuff you post. Whisky Shop Near me