Skip to content

Instantly share code, notes, and snippets.

@trentm
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trentm/1d69ad9b98dfe422c406 to your computer and use it in GitHub Desktop.
Save trentm/1d69ad9b98dfe422c406 to your computer and use it in GitHub Desktop.
[trent.mick@us-east /trent.mick/stor/tmp]$ find play2/
play2/
play2//bar.txt
play2//foo.txt
play2//subdir
play2//subdir/b
play2//subdir/b/b.txt
[trent.mick@us-east /trent.mick/stor/tmp]$ find play2
play2
play2/bar.txt
play2/foo.txt
play2/subdir
play2/subdir/b
play2/subdir/b/b.txt
[trent.mick@us-east /trent.mick/stor/tmp]$ mv play2 play3
mantash: INFO: mkdir -p /trent.mick/stor/tmp/play3/subdir/b
mantash: INFO: mv /trent.mick/stor/tmp/play2/subdir/b/b.txt /trent.mick/stor/tmp/play3/subdir/b/b.txt
mantash: INFO: rmdir /trent.mick/stor/tmp/play2/subdir/b
mantash: INFO: mkdir -p /trent.mick/stor/tmp/play3/subdir
mantash: INFO: rmdir /trent.mick/stor/tmp/play2/subdir
mantash: INFO: mkdir -p /trent.mick/stor/tmp/play3/
mantash: INFO: mv /trent.mick/stor/tmp/play2/bar.txt /trent.mick/stor/tmp/play3/bar.txt
mantash: INFO: mv /trent.mick/stor/tmp/play2/foo.txt /trent.mick/stor/tmp/play3/foo.txt
mantash: INFO: rmdir /trent.mick/stor/tmp/play2
[trent.mick@us-east /trent.mick/stor/tmp]$ ls play/
bar.txt
foo.txt
[trent.mick@us-east /trent.mick/stor/tmp]$ mv play play2
mantash: INFO: mkdir -p /trent.mick/stor/tmp/play2/
mantash: INFO: mv /trent.mick/stor/tmp/play/bar.txt /trent.mick/stor/tmp/play2/bar.txt
mantash: INFO: mv /trent.mick/stor/tmp/play/foo.txt /trent.mick/stor/tmp/play2/foo.txt
mantash: INFO: rmdir /trent.mick/stor/tmp/play
[trent.mick@us-east /trent.mick/stor/tmp]$ ls play2/
bar.txt
foo.txt
$ mantash mv -h
move file(s)/dir(s) in manta
Usage:
mv MANTA-SOURCE MANTA-DEST
mv MANTA-SOURCE ... MANTA-DEST-DIRECTORY
Options:
-h, --help show this help message and exit
--dry-run do a dry-run
-f, --force do not stop on overwriting a target file
-q, --quiet show files as they are being moved
-v, --verbose show files as they are being moved. This is the default.
Note: The eventual goal is to behave like a typical `mv` but for now
this will error out if it hits target files in the way.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment