Skip to content

Instantly share code, notes, and snippets.

@rhydlewis
Created November 1, 2016 14:24
Show Gist options
  • Save rhydlewis/9d4e5ff5850696dbdfe156c30b4a7d38 to your computer and use it in GitHub Desktop.
Save rhydlewis/9d4e5ff5850696dbdfe156c30b4a7d38 to your computer and use it in GitHub Desktop.
Useful Bash commands
# Find and count file extensions in a directory
find . -type f | sed -e 's/.*\.//' | sort | uniq -c | sort -rn
# Rename group of files
for old in \*.txt; do mv $old `basename $old .txt`.md; done
# Resize group of images
for f in \*.jpg; do convert $f $f.pdf; done
# Download youtube playlist video
youtube-dl -o '%(title)s.%(ext)s' "https://www.youtube.com/watch?v=GYFteQuoT-o&list=PLGOsbT2r-igmFK9IKEGAnBaklqtuW7l8W"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment