Skip to content

Instantly share code, notes, and snippets.

@jcanfield
Created June 10, 2017 23:23
Show Gist options
  • Save jcanfield/e32f3b011f62bda8259c77f217295cd9 to your computer and use it in GitHub Desktop.
Save jcanfield/e32f3b011f62bda8259c77f217295cd9 to your computer and use it in GitHub Desktop.
Move a TV Show or Movie directory to another folder or drive
#!/bin/bash
# SYNOPSIS: Move a TV Show or Movie directory to another folder or drive
# USAGE:
# NOTES: The Function cp_p was discovered on StackExchange at http://j.mp/1OOqAV1.
#cp_p()
#{
# strace -q -ewrite cp -- "${1}" "${2}" 2>&1 \
# | awk '{
# count += $NF
# if (count % 10 == 0) {
# percent = count / total_size * 100
# printf "%3d%% [", percent
# for (i=0;i<=percent;i++)
# printf "="
# printf ">"
# for (i=percent;i<100;i++)
# printf " "
# printf "]\r"
# }
# }
# END { print "" }' total_size=$(stat -c '%s' "${1}") count=0
#}
echo "Moving $1 to $2..."
mv -v "$1" "$2"
echo "Move of '$1' Successful."
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment