DEV Community

Denys
Denys

Posted on

How count up lines in a directory

Description

Quick overview of counting up lines inside the directory for all files.

CLI

find "$1" -type f -exec cat {} + | wc -l
🏆 ยอดนิยม: lgtome/how count up lines in a directory op - Kapook Update 2025 🏆 ยอดนิยม: lgtome/how count up lines in a directory op - Kapook Update 2025

ZSH or Bash config

clines() {
  if [ -z "$1" ]; then
    echo "Provider folder argument please."
  else
    find "$1" -type f -exec cat {} + | wc -l
  fi
}
🏆 ยอดนิยม: lgtome/how count up lines in a directory op - Kapook Update 2025 🏆 ยอดนิยม: lgtome/how count up lines in a directory op - Kapook Update 2025

Thanks for your attention. Be happy.

Top comments (0)