Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bfontaine/mvb
:rewind: mv. reversed.
https://github.com/bfontaine/mvb
cli shell tool
Last synced: 10 days ago
JSON representation
:rewind: mv. reversed.
- Host: GitHub
- URL: https://github.com/bfontaine/mvb
- Owner: bfontaine
- License: mit
- Created: 2014-05-19T10:02:00.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-10-04T16:55:23.000Z (over 9 years ago)
- Last Synced: 2025-01-28T23:09:20.056Z (17 days ago)
- Topics: cli, shell, tool
- Language: Shell
- Homepage:
- Size: 160 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mvb
`mvb` is a little utility to move files back. It’s like `mv`, but reversed.
Have you ever moved the wrong file with `mv`, and edited your previous command
to mv back the file? With `mvb`, all you need to do is to re-run your command
with a `b` at the end of `mv`. That’s it.$ mv foo/bar/qux/myfile abc/xyz/myfile2
# damn, wrong file, let’s move it back
$ mvb foo/bar/qux/myfile abc/xyz/myfile2## Features
* no dependencies
* all `mv` options are supported## Install
mkdir -p ~/bin
curl https://raw.github.com/bfontaine/mvb/master/mvb > ~/bin/mvb
chmod u+x ~/bin/mvbThis creates the `~/bin` directory if it doesn’t exist. If it’s not in your
`PATH` you have to add it:echo 'export PATH="$HOME/bin:$PATH"' >> ~/.bashrc
### Using Homebrew
On OS X with [Homebrew](http://brew.sh/), use:
brew install bfontaine/utils/mvb
## Caveats
A lot of `mv` variations can’t be reverted without much informations, for
example:mv foo/* bar/
Thus, `mvb` handles only simple cases where a file is renamed/moved; not
complex ones involving glob patterns and directories renaming. By default,
`mvb` runs `mv` on its (switched) arguments. If the last path ends with a
slash, it appends the first file’s name to it before continuing.For example, `mvb foo bar` is equivalent to `mv bar foo`; while `mvb foo bar/`
is equivalent to `mv bar/foo foo`.