Some utilities for Unix systems; main goals include convenience, safety, and flexibility.
mv.py
is a replacement for the Unix built-in mv
, including functionality
from rsync
and rename
such as recursive directory merging, checksums/data
integrity verification, and pattern-based renaming.
By default, mv.py
includes some useful replacements that will be expanded
(textually) for each file:
#
: an integer representing how many files and directories were moved before the current one@
: the parent directory of the source/origin file or directory (useful for recursively handling nested directory structures, or when operating on a long file path)%
: the file extension/suffix, including the.
Some examples:
rename a file
python mv.py image.png test.png
rename a file
python mv.py ./image.png ./test.png
move a file (test-dir exists)
python mv.py image.png test-dir/image.png
move a file (test-dir exists)
python mv.py image.png test-dir
move a file (test-dir does not exist)
python mv.py -c image.png test-dir
move files matching a pattern
python mv.py -c '*.png' images
move files matching a pattern and rename by index
python mv.py -c '*.png' 'images/image-#.png'
move files with multiple extensions
python mv.py -c './source/*.*' 'images/image-#%'
move files and print details to stdout
python mv.py -c -v '*.png' 'images/image-#.png'
move files recursively
python mv.py -c './**/*.png' 'images/image-#.png'
move files recursively, preserving directory structure
python mv.py -c './**/*.png' 'images/@'
dev
: development branch where new features can be implemented and tested before being merged into the stablemain
branchdocs
: various documentation (mostly aimed at the end user)main
: main branch into which others are merged once stablemeta
: information about this repository (branches, code, etc.)mv-docs
: documentation formv.py
mv-undo
: implementing undo functionality inmv.py
(see issue #2)mv
: script for easily moving files and directories in bulk
cloc | github.com/AlDanial/cloc v 1.82 T=0.02 s (191.5 files/s, 12929.1 lines/s) |
---|
Language | files | blank | comment | code |
---|---|---|---|---|
Markdown | 2 | 51 | 0 | 163 |
Python | 2 | 10 | 8 | 38 |
-------- | -------- | -------- | -------- | -------- |
SUM: | 4 | 61 | 8 | 201 |