Find linux command to get all extensions in a directory

Find linux command to get all extensions in a directory

Find all extensions in a directory

find . -type f | sed -e 's/.*\.//' | sed -e 's/.*\///' | sort -u

Find all extensions in a directory with count

find . -type f | sed -e 's/.*\.//' | sed -e 's/.*\///' | sort | uniq -c | sort -rn

Find all extensions in a directory using awk and grep command.

find . -type f -name "*.*" | grep -o -E "\.[^\.]+$" | grep -o -E "[[:alpha:]]{1,100}" | awk '{print tolower($0)}' | sort -u

 

25 simple examples of Linux find command

Share this post

Leave a Reply

Your email address will not be published. Required fields are marked *