Skip to content

Latest commit

 

History

History
9 lines (7 loc) · 259 Bytes

count_files.md

File metadata and controls

9 lines (7 loc) · 259 Bytes

Count number of files in a directory

ls -1 /tmp | wc -l
  • /tmp - directory to count files in (including subdirectories)
  • -1 - ensure there's only one line per file
  • wc -l - count number of lines outputted by ls (thus, number of files)