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
Enter fullscreen mode Exit fullscreen mode

ZSH or Bash config

clines() {
  if [ -z "$1" ]; then
    echo "Provider folder argument please."
  else
    find "$1" -type f -exec cat {} + | wc -l
  fi
}
Enter fullscreen mode Exit fullscreen mode

Thanks for your attention. Be happy.

Top comments (0)