Skip to content

Tag: awk

all files extensions in this folder

find . -type f -name "*.*" | awk -F. '{print $NF}' | sort -u

How it works:

  • find . -type f: Looks only at files (not directories) in the current folder
  • -name "*.*": Ensures it only processes files that actually have a dot (an extension).
  • awk -F. '{print $NF}': Splits the filenames by the dot and prints only the very last part.
  • sort -u: Sorts the list alphabetically and removes any duplicates.