STORY of AODDY. » Post 'Count files in sub directory.'

Count files in sub directory.

ครับตามชื่อ หัวข้อ ผมต้องการนับว่าใน Current Directory ที่ผมอยู่มีไฟล์ทั้งหมดกี่ไฟล์ และถ้าใน Current Directory มี Subdirectory แล้วก็ใน Subdirectory มีไฟล์ซ่อนอยู่ ก็ให้นับรวมมาด้วย โดยไม่นับรวม Subdirectory นั้นๆ คำสั่งเป็นดังนี้
# find . -type f
./a.txt
./b.txt
./aa/aa.txt
./bb/bb.txt
# find . -type f | wc -l
4

เป็นอันเสร็จพิธี…ที่มาก็มาจากเจ้ Goo นั้นแหละครับผม

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
Tags:

Leave a comment

XHTML - You can use:<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

© 2008 STORY of AODDY. is powered by WordPress