Quantcast
Channel: Count number of files with specific extension(s) for each subdirectory - Ask Ubuntu
Browsing all 4 articles
Browse latest View live

Answer by Liso for Count number of files with specific extension(s) for each...

Here's from mine, modified from this answer.find . -maxdepth 100 -type d -print0 | while read -d '' -r dir; do count=$(find "$dir" -maxdepth 1 -type f \( -name '*.jpg' -o -name '*.png' \) -ls | wc -l);...

View Article



Answer by mashuptwice for Count number of files with specific extension(s)...

Find has logical operators like AND, NOT and OR.To specify more than one extension to search for you need to put the arguments in parentheses, as well as escape the parentheses to avoid them being...

View Article

Answer by pa4080 for Count number of files with specific extension(s) for...

Probably this find|xargs solution will work as you need.find . -mindepth 1 -maxdepth 99 -type d -print0 | \xargs -0 -i bash -c 'printf "%10d\t%s\n" "$(find "$1" -maxdepth 1 -type f -regextype awk...

View Article

Count number of files with specific extension(s) for each subdirectory

Source: Any directory tree with any number and type of files. Q: How many .jpg or .jpg and .png (for example) are in each subdirectory?How can I limit the code below for files with 1 or more specific...

View Article
Browsing all 4 articles
Browse latest View live




Latest Images