An open API service indexing awesome lists of open source software.

https://github.com/bulletmark/rename-clean

Utility to replace undesirable characters in Linux file names
https://github.com/bulletmark/rename-clean

rename rename-files rename-files-and-directories

Last synced: 29 days ago
JSON representation

Utility to replace undesirable characters in Linux file names

Awesome Lists containing this project

README

          

## RENAME-CLEAN - Replace Undesirable Characters in Linux File Names
[![PyPi](https://img.shields.io/pypi/v/rename-clean)](https://pypi.org/project/rename-clean/)

The [`rename-clean`][rename-clean] command line utility replaces undesirable
characters with underscores in Linux file names. Undesirable characters are any
that are not ASCII alphanumeric (`0-9`, `a-z`, `A-Z`), underscore (`_`), hyphen
(`-`), or dot (`.`). If characters are replaced, then repeated underscores are
also reduced to a single underscore and trimmed from the name stem and suffix.
A unique name is always created by appending a number on the name stem if
necessary.

I use it after downloading an archive of files from the internet such as a
torrent to remove spaces, emojis, and other odd characters from the file names.

Example usage follows:

Clean up all file and directory names in the current directory:

```sh
$ rename-clean (or rename-clean .)
```

Clean up all file and directory names in the current directory and recursively
under any child directories:

```sh
$ rename-clean -r
```

Clean up all all jpeg file names in current directory:

```sh
$ rename-clean *.jpg
```

Read a list of names to be cleaned up from a file:

```sh
$ rename-clean - for more details.

[rename-clean]: https://github.com/bulletmark/rename-clean
[uvtool]: https://docs.astral.sh/uv/guides/tools/#installing-tools
[uvx]: https://docs.astral.sh/uv/guides/tools/#running-tools