github.com/wsand02/massren@v1.5.5-0.20191104203215-f721006d1e4e/README.md (about) 1 ## Massren [![Build Status](https://travis-ci.org/laurent22/massren.svg?branch=master)](https://travis-ci.org/laurent22/massren) 2 3 Massren is a command line tool that can be used to rename multiple files using your own text editor. Multiple-rename tools are usually difficult to use from the command line since any regular expression needs to be escaped, and each tool uses its own syntax and flavor of regex. The advantage of massren is that you are using the text editor you use every day, and so can use all its features. 4 5 The tool works by creating a file that contains the filenames of the target directory, and opening this file in the text editor. You can then modify the filenames there directly. Once done, save the text file and the files will be renamed. Lines that are not changed will simply be ignored. 6 7 ![Massren usage animation](https://raw.github.com/laurent22/massren/animation/animation.gif "Massren usage animation") 8 9 ## Features 10 11 - Rename multiple files using your own text editor. It should work with any text editor, including vim, emacs, Sublime Text or notepad. 12 13 - Undo - any rename operation can be undone. 14 15 - Move files to sub-directories. See [these instructions](https://github.com/laurent22/massren/releases/tag/v1.4.0) for more information. 16 17 - Dry run mode - test the results of a rename operation without actually renaming any file. 18 19 - Cross-platform - Windows, OSX and Linux are supported. 20 21 - Safety checks - since this is a multiple rename tool, various checks are in place to ensure that nothing gets accidentally renamed. For example, the program will check that the files are not being changed by something else while the list of filenames is being edited. If the number of files before and after saving the file is different, the operation will also be cancelled. 22 23 ## Installation 24 25 The latest executables for each platform are available from the [release page](https://github.com/laurent22/massren/releases). 26 27 ### Mac OS 28 29 The easiest way is with Homebrew: 30 31 brew install massren 32 33 Alternatively, the Linux method described below should work. 34 35 If the installation fails, please follow the [instructions below](#building-from-source). 36 37 ### Linux 38 39 - [Install Go](https://golang.org/doc/install#tarball) 40 - Run `go get -u github.com/laurent22/massren` 41 - Run `go install github.com/laurent22/massren` 42 43 By default, the tool will be installed in `$GOPATH/bin/massren`. From there, you can either symlink it to `/bin` or add `$GOPATH/bin` to your `PATH` variable with `export PATH=$PATH:$GOPATH/bin`. 44 45 Note that it is compatible with Linuxbrew, so the same commands as for Mac OS would work too. 46 47 ### Windows 48 49 The executable can be downloaded from https://github.com/laurent22/massren/releases 50 51 Note: Windows releases are discontinued as of version 1.3, as I do not know if they are used by anyone. The program still works with Windows though, and can be built and installed using the "Linux" method above. If you have any interest in maintaining the Windows releases, please let me know. 52 53 ## Usage and examples 54 55 Usage: 56 massren [OPTIONS] 57 58 Application Options: 59 -n, --dry-run Don't rename anything but show the operation that would have 60 been performed. 61 -v, --verbose Enable verbose output. 62 -c, --config Set or list configuration values. For more info, type: 63 massren --config --help 64 -u, --undo Undo a rename operation. Currently delete operations cannot be 65 undone (though files can be recovered from the trash in OSX 66 and Windows). eg. massren --undo [path] 67 -V, --version Displays version information. 68 69 Help Options: 70 -h, --help Show this help message 71 72 Examples: 73 74 Process all the files in the current directory: 75 % massren 76 77 Process all the JPEGs in the specified directory: 78 % massren /path/to/photos/*.jpg 79 80 Undo the changes done by the previous operation: 81 % massren --undo /path/to/photos/*.jpg 82 83 Set VIM as the default text editor: 84 % massren --config editor vim 85 86 List config values: 87 % massren --config 88 89 ## Configuration 90 91 Type `massren --help --config` (or `massren -ch`) to view the possible configuration values and defaults: 92 93 Config commands: 94 95 Set a value: 96 % massren --config <name> <value> 97 98 List all the values: 99 % massren --config 100 101 Delete a value: 102 % massren --config <name> 103 104 Possible key/values: 105 106 editor: The editor to use when editing the list of files. 107 Default: auto-detected. 108 109 use_trash: Whether files should be moved to the trash/recycle bin 110 after deletion. Possible values: 0 or 1. Default: 1. 111 112 include_directories: Whether to include the directories in the file buffer. 113 Possible values: 0 or 1. Default: 1. 114 115 include_header: Whether to show the header in the file buffer. Possible 116 values: 0 or 1. Default: 1. 117 118 Examples: 119 120 Set Sublime as the default text editor: 121 % massren --config editor "subl -n -w" 122 123 Don't move files to trash: 124 % massren --config use_trash 0 125 126 ## TODO 127 128 - Move files to trash in bulk instead of one by one. 129 - Detect default text editor on Windows. 130 - Disambiguate filenames when processing two or more folders that contain the same filenames. 131 - Other [various issues](https://github.com/laurent22/massren/issues). 132 133 ## Building from source 134 135 - Go 1.3+ is required 136 137 go get github.com/laurent22/massren 138 go build 139 140 - If it doesn't build on OSX, try with: 141 142 go get -x -ldflags -linkmode=external github.com/laurent22/massren 143 144 More info in [this issue](https://github.com/laurent22/massren/issues/7). 145 146 ## Test units 147 148 Massren functionalities are supported by a robust test suite that has nearly complete code coverage. To run the test units, type `go test -v` from the source code directory. 149 150 ## License 151 152 The MIT License (MIT) 153 154 Copyright (c) 2013-2016 Laurent Cozic 155 156 Permission is hereby granted, free of charge, to any person obtaining a copy 157 of this software and associated documentation files (the "Software"), to deal 158 in the Software without restriction, including without limitation the rights 159 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 160 copies of the Software, and to permit persons to whom the Software is 161 furnished to do so, subject to the following conditions: 162 163 The above copyright notice and this permission notice shall be included in 164 all copies or substantial portions of the Software. 165 166 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 167 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 168 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 169 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 170 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 171 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 172 THE SOFTWARE.