I have a folder with lots of files and folder. It contains many multimedia files (jpg, jpeg, mp4, mpeg). The directory also contains lots of sub folders.
I want to do two things :
Find the total counts of all files
Find the total size used by the files and folder.
I want to exclude files with some particular extensions, like exclude mp4, jpeg files. I also want to exclude a list of folders also. Suppose I have 1000 files and 200 folders. Out of these files, I want to exclude files with some particular extensions and some folders. Like if I have 26 folders named a-z, I want to exclude the folders named h, f, y and so on.
The final output, of the total number of files present and the size they occupy should not contain these files and folders.
I have made an effort towards it and 90% is completed, the command exludes all the files and directories present but it prints the folder name as well, I just want the file name in the output.
find . -type d \( -path "*/Make-Directory-Script-master" -o -path "*/pycharm-community-2020.3" \) -prune -o -type f \( -name "*.zip" -o -name "*.pdf" -o -name "*.js" -o -name "*.json" -o -name "*.css" -o -name "*.srt" \) -prune -o -print
Any help will be appreciated 🙂🙂