DEV Community

ted537
ted537

Posted on

Unmove files with bash

A simple little shortcut idea that might be handy when juggling files with long names.

# Define a bash alias. Could be plopped in ~/.bashrc
unmv() { mv $2 $1; }
# Move a file out of the way to dodge some script
# ------------------>
mv my-file my-file.bak
# Do some stuff
# Unmove the file back to its original position
# <------------------
unmv my-file my-file.bak
Enter fullscreen mode Exit fullscreen mode

Top comments (0)