DEV Community

Cover image for Count files in a directory in Linux
Adam K Dean
Adam K Dean

Posted on

Count files in a directory in Linux

Count files in current directory with:

ls | wc -l
Enter fullscreen mode Exit fullscreen mode

Or count files in a specific directory with:

ls /some/path | wc -l
Enter fullscreen mode Exit fullscreen mode

Top comments (0)