Skip to content

Latest commit

 

History

History
195 lines (140 loc) · 7.34 KB

README.md

File metadata and controls

195 lines (140 loc) · 7.34 KB

Interactive File Renamer (InFiRen)

Interactively rename multiple files from the command line. Especially useful to organize large collections of images, videos, music, etc.

Donations

I'm striving to become a full-time developer of Free and open-source software (FOSS). Donations help me achieve that goal and are highly appreciated.

Buy Me A Coffee   Donate via PayPal   Donate via Ko-fi

Requirements

Operating System:
Linux, FreeBSD, macOS, Windows

Dependencies:
Bash (>=v5.0), GNU find (part of findutils) -or- BSD find (available on FreeBSD/macOS), coreutils (provide basic tools like dirname, basename, mkdir, sort, etc.)

Note:

macOS users might want to use Homebrew to install missing dependencies.

Windows users need to set up a suitable runtime environment: Cygwin, MSYS2, Git for Windows or Windows Subsystem for Linux should all work fine. Git for Windows might be a good choice to get started - it is reasonably lightweight, easy to to set up, meets all requirements out of the box and is also available as a portable version.

Download & Installation

Refer to the releases section for downloads links. There is no actual installation required. Simply extract the downloaded archive to a folder of your choice.

Configuration

Open infiren.conf in your favorite text editor and adjust the settings to your liking. Refer to embedded comments for details. Refer to this section for a list of configuration options and current defaults.

Quick Start

To start InFiRen, use the following command (specifying an initial directory is optional):

$ infiren.sh [INITIAL-DIRECTORY]

Within InFiRen, enter help or refer to this section for a list of available interactive commands.

Run infiren.sh --help or refer to this section for a list of available command line options.

Showcase

Animated GIF

Interactive Commands

Available interactive commands:

rs, replace-string STR REP    Replace string STR with replacement REP
re, replace-regex RE TMP      Match regular expression RE and replace
                              matching string according to template TMP
                              (e.g. re "([0-9]+)x([0-9]+)" "S\1E\2")
pr, pre, prepend STR          Prepend string STR
po, post, append STR          Append string STR
rd, replace-dots              Replace single dots with spaces
id, insert-dash               Insert dash after first word
ca, capitalize                Capitalize space-separated words
up, upper, uppercase          Convert all characters to uppercase
lo, lower, lowercase          Convert all characters to lowercase
tr, trim, st, strip           Trim leading and trailing whitespace

rm, record-macro              Start/stop recording macro
vm, view-macro                View macro contents
cm, clear-macro               Clear macro contents
pm, play-macro                Play back commands stored in macro
pd, playback-delay VALUE      Set delay in between commands for command
                              playback to VALUE (in seconds, fractions
                              are supported)

sm, save-macro NAME           Save macro using name NAME to macro file
lm, load-macro NAME           Load macro named NAME from macro file
dm, delete-macro NAME         Delete macro named NAME from macro file
im, list-macros               List all macros stored in macro file

hm, history-macro             Create macro from command history
vh, view-history              View command history
ch, clear-history             Clear command history

fp, filter-pattern PATTERN    Set filter pattern to PATTERN and reload
                              files
if, invert-filter             Invert filter and reload files
fc, filter-case               Toggle filter case and reload files
vf, view-filter               View current filter state
rf, reset-filter              Reset filter and reload files

ed, edit INDEX                Manually edit entry with index INDEX
ud, undo                      Undo/redo last name-altering operation
rc, recursive                 Toggle recursive mode and reload files
cd, chdir PATH                Change directory to PATH and reload files

apply, save                   Apply changes (i.e. rename files)
reload, reset                 Discard changes and reload files

help, usage                   Display this help/usage text
exit, quit                    Exit program (shortcut: CTRL+D)

Command Line Options

Available command line options:

Usage: infiren.sh [INITIAL-DIRECTORY] [CMD]...
Note:  Commands are executed right after startup

Configuration Options

Available configuration options (and defaults):

# Initial directory (if empty, current working directory is used)
INITIAL_DIRECTORY=""

# Initial filter pattern (see 'man find', option '-name pattern' for syntax;
# '*' == all files)
FILTER_PATTERN="*"

# Initial filter invert setting ('true'/'false'; 'true' == inversion enabled)
FILTER_INVERT="false"

# Initial filter case setting ('true'/'false'; 'true' == case sensitive)
FILTER_CASE="false"

# Initial recursive mode setting ('true'/'false'; 'true' == recursion enabled)
RECURSIVE_MODE="false"

# Initial command playback delay (in seconds, fractions are supported; '0' ==
# no delay)
PLAYBACK_DELAY="0.25"

# Options passed to 'sort' when sorting file/folder listings (see 'man sort'
# for valid/available options)
SORT_OPTS=("-V")

# Load/save command history from/to file on startup/exit ('true'/'false')
PERSISTENT_HISTORY="true"

# File used to store command history (only if PERSISTENT_HISTORY is enabled)
# ${APP_DIR}:  directory where app executable ('infiren.sh') is stored
# ${APP_NAME}: name of app executable ('infiren.sh') without extension
# ${HOME}:     home directory of user running/executing the application
#HISTORY_FILE="${HOME}/.config/${APP_NAME}/${APP_NAME}.hst"
HISTORY_FILE="${APP_DIR}/${APP_NAME}.hst"

# File used to store macros (managed via commands 'save-macro'/'load-macro')
# ${APP_DIR}:  directory where app executable ('infiren.sh') is stored
# ${APP_NAME}: name of app executable ('infiren.sh') without extension
# ${HOME}:     home directory of user running/executing the application
#MACROS_FILE="${HOME}/.config/${APP_NAME}/${APP_NAME}.mac"
MACROS_FILE="${APP_DIR}/${APP_NAME}.mac"

Last updated: 04/25/24