Skip to content

Instantly share code, notes, and snippets.

@yazdipour
Last active March 26, 2019 04:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yazdipour/55e17501a372f8d255a23eb3ac1c91ff to your computer and use it in GitHub Desktop.
Save yazdipour/55e17501a372f8d255a23eb3ac1c91ff to your computer and use it in GitHub Desktop.
# 05_h.png >> 05_half.png
for file in *.png; do mv "$file" "${file/_h.png/_half.png}"; echo $f;done
# * >> *.mp4
for file in *; do mv "$file" "$file.mp4";done
# */*/ -rec >> remove *.pdf && *.doc
IFS=$'\n'; set -f ## To skip problem of directories with spaces
for f in $(find . -name '*.pdf' -or -name '*.doc'); do rm "$f"; echo $f;done
unset IFS; set +f
# rm empty Dirs
IFS=$'\n'; set -f
for f in $(find . -type d -empty);do rm -r "$f" ;echo $f;done
unset IFS; set +f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment