Difference between revisions of "Find"
Jump to navigation
Jump to search
(Created page with "=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 pa...") |
(No difference)
|
Latest revision as of 08:31, 10 January 2019
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}'