-
-
Save johnwook/39465754eb22f429108a6b183fd36aea to your computer and use it in GitHub Desktop.
Rename files in fish using mv command without typing the full name two times
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function rename | |
if test (count $argv) -ne 1 | |
or test ! -f $argv[1] | |
command mv $argv | |
return | |
end | |
set newfilename $argv[1] | |
vared newfilename | |
command mv -v -- $argv[1] $newfilename | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment