Skip to content

Instantly share code, notes, and snippets.

@xtman
Created June 12, 2024 04:35
Show Gist options
  • Save xtman/b9dd1c35c6f657867c46ce8c6cda18be to your computer and use it in GitHub Desktop.
Save xtman/b9dd1c35c6f657867c46ce8c6cda18be to your computer and use it in GitHub Desktop.
count-files-in-dir.sh
#!/bin/sh
[ $# -ne 1 ] && echo "$(basename $0) <dir>" && exit 1
[ ! -d $1 ] && echo "$1 is not a directory." && exit 1
find "$1" -type f | wc -l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment