- Home
- Uncategorized
- Counting Files in a Directory Linux
Counting Files in a Directory Linux
It’s often useful to count how many files are in a folder as a sanity check or as a metric for analysis. Here is the linux command for counting the number of files (not dotfiles) in a directory:
ls -1 /usr/path/2/my/dir/ | wc -l