+
Skip to content

akeda2/randrn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

randrn

Random filename renamer

Use-case #1:

You have an amount of files with garbled names. Use this to rename files to more easy to maintain names: By default, including:

  • Modyfied date and time
  • Counting from 0001 to 9999, sorted by modyfied date/time
  • 16 alphanumerical random characters
  • Original extension or one by your choice

Example:

$ randrn *.txt
'Some file name with &%¤# in it.txt' --> 2022-12-12_09-49-45_0001_cya5x6mk6spb19tt.txt

Use-case #2:

You have an amount of files with non alphanumerical characters in the file name/garbage filenames.

  • Use "-a or --auto" Only renames files which actually have garbage in the filenames.
  • Use "-S or --strip" Only strips out garbage and replaces it with alphanumerical randomness.

Example of --strip:

$ randrn --strip Some*
Some file name with &%¤# in it.txt --> Some_file_name_with__0i29kwlg_in_it.txt
Spaces are replaced with underscores, then garbage characters are replaced with alphanumerical random characters.

Installation:

To build with pyinstaller:
make
make install
To just copy to /usr/local/bin/randrn:
./inst.sh

Usage:

randrn -h
usage: randrn [-h] [-a] [-S] [-e EXTENSION] [-d] [-R] [-n] [wildcard]

randrn - rename files with random names

positional arguments:
  wildcard              A wildcard pattern to match filenames (default: *)

options:
  -h, --help            show this help message and exit
  -a, --auto            Auto rename only filenames with non alphanumerical characters (default: False)
  -S, --strip           Strip mode: Just strip away non alphanumerical characters (default: False)
  -e EXTENSION, --extension EXTENSION
                        Extension to set for new filename (default: False)
  -d, --dir             Also rename directories (default: False)
  -R, --recursive       Recursive mode (default: False)
  -n, --now             Use datetime NOW iso mtime (default: False)

About

Random name renamer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载