LinuxGem
此处为老的 LinuxGem,新版 LinuxGem 请移步 www.linuxgem.org

只列出目录 & 统计目录数目

galeki posted @ 2007年10月05日 07:46 in Bash 和它的朋友们 with tags 目录 ls , 3361 阅读

在控制台下,如果想只列出当前文件夹下的目录,只要:

# ls  -d  */

-d 属性只列出目录名称,而不列出目录中的内容,目录在控制台下的显示都以 “/“ 为结尾,所有的目录即为 “*/” 了。

当然,你也规定条件,比如,只列出 b 开头的目录:

# ls  -d  b*/

如果你想列出隐藏目录:

# ls  -d  .*/

如果你想统计目录数目,把结果传给 wc 即可:

# ls  -d  */  -l  |  wc  -l

剩下的大家自由发挥吧……

  

转自:

http://linux.byexamples.com/archives/314/how-to-list-just-directories-the-correct-way/

http://blog.linuxgem.org/liulang/show/443.html

faddy 说:
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

HASNA 说:
2022年9月03日 21:23

Glimpse upon the idea within a lot similar manner when you would likely in case you were being building an not online jacksonville seo small business, which will, as a way to become sucessful, needs responsibility plus a good approach from the particular canceled out, using short pay back while in the first days to weeks. https://www.simplybuzzes.com/angel-number-7766-meaning/

anonymous 说:
2023年9月08日 21:11

Acknowledges for paper such a beneficial composition, I stumbled beside your blog besides decipher a limited announce. I want your technique of inscription... Kissimmee Bed Bug Treatment

anonymous 说:
2023年9月13日 19:09

Very interesting information, worth recommending. However, I recommend this:  Orlando Termite Control

anonymous 说:
2023年9月13日 19:11

I should say only that its awesome! The blog is informational and always produce amazing things. Oviedo Termite Control

anonymous 说:
2023年10月25日 17:11

On that website page, you'll see your description, why not read through this. Online CPA

anonymous 说:
2023年11月21日 02:27

You should mainly superior together with well-performing material, which means that see it: Best roofers in Winnipeg

anonymous 说:
2023年11月29日 18:21

Tax credit evaluation services. Section 179D Green Energy Incentive. Schedule a free consultation to find out if your company qualifies for the 179D Green Energy Incentive.

anonymous 说:
2023年12月05日 20:51

I exploit solely premium quality products -- you will observe these individuals on: Buy semaglutide New York

anonymous 说:
2023年12月13日 23:54

It is somewhat fantastic, and yet check out the advice at this treat. Enphase IQ-Combiner X-IQ-AM1-240-3-ES


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter