Skip to content

Instantly share code, notes, and snippets.

@jdavis
Created October 4, 2018 18:50
Show Gist options
  • Save jdavis/f48c0bc75027f536ceb7a872bc0a0a27 to your computer and use it in GitHub Desktop.
Save jdavis/f48c0bc75027f536ceb7a872bc0a0a27 to your computer and use it in GitHub Desktop.
# Rename a file and keep it in the same location
rename() {
if [ "$#" -ne 2 ]; then
echo "usage: $0 path/to/file/old_name new_name"
return
fi
mv $1 `dirname $1`/$2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment