Skip to content

Instantly share code, notes, and snippets.

@telmotrooper
Created May 21, 2019 19:22
Show Gist options
  • Save telmotrooper/852a72b3afebe5f982fc2951daf4cd47 to your computer and use it in GitHub Desktop.
Save telmotrooper/852a72b3afebe5f982fc2951daf4cd47 to your computer and use it in GitHub Desktop.
ls separated by extensions
#!/usr/bin/bash
extensions=$(ls -l | awk '{print $9}' | cut -f 2-99 -d '.' | uniq)
for ext in $extensions
do
echo "-- $ext --"
ls -l | grep ".$ext" | awk '{print $9,$5}' | column -t -s " "
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment