DEV Community

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

Posted on

2 1

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)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs