Find
Jump to navigation
Jump to search
Find in linux
Find all unique file extensions in a folder:
find . -type f | awk -F . '{print $NF}' | tr '[:upper:]' '[:lower:]' | sort -u
Get file size for all files of particular extension:
find . -name "*.txt" | xargs -d '\n' du -sk > /tmp/sum cat /tmp/sum | awk -F '\n' '{sum+=$NF} END {print sum}'