Skip to content

Latest commit

 

History

History
158 lines (106 loc) · 4.63 KB

README.md

File metadata and controls

158 lines (106 loc) · 4.63 KB


Logo

CrossRename

Harmonize file names for Linux and Windows.
Explore the repo »

Table of Contents

Introduction

CrossRename is a command-line tool designed to harmonize file names across Linux and Windows systems. It ensures that your file names are compatible with both operating systems, eliminating naming conflicts when transferring files between different environments.

(back to top)

Features

  • Sanitizes file names to be Windows-compatible (and thus Linux-compatible)
  • Handles both individual files and entire directories
  • Supports recursive renaming of files in subdirectories
  • Preserves file extensions, including compound extensions like .tar.gz
  • Provides informative logging
  • Provides a dry-run mode to preview renaming changes without executing them
  • Skips recursive symlinks to avoid infinite loops

(back to top)

Installation

From PyPI (Using PIP)

pip install CrossRename

(back to top)

Usage

usage: crossrename [-h] [-p PATH] [-v] [-u] [-r] [-d]

CrossRename: Harmonize file names for Linux and Windows.

options:
  -h, --help            show this help message and exit
  -p PATH, --path PATH  The path to the file or directory to rename.
  -v, --version         Prints out the current version and quits.
  -u, --update          Check if a new version is available.
  -r, --recursive       Rename all files in the directory path given and its subdirectories.
  -d, --dry-run         Perform a dry run, logging changes without renaming.


(back to top)

Examples

Rename a single file:

crossrename -p /path/to/file.txt

Rename all files in a directory (and its subdirectories ):

crossrename -p /path/to/directory -r

Perform a dry run to preview renaming changes without executing them:

crossrename -p /path/to/directory -r -d

Check for an update:

crossrename -u

(back to top)

Why did I build this?

Warning

I'm no longer dual booting. I'm only using Windows 10 now. I do have WSL2 and that's what I use for testing. I don't know if there'll be any difference in the way the tool works on a native Linux system.

I'm a dual-booter running Windows 10 and Lubuntu 22.04. One day (literally yesterday lol), while transferring a folder between the two systems, I hit a naming roadblock. Five stubborn files refused to budge, thanks to the quirky differences in file naming rules between Linux and Windows.

This experience got me thinking. You see, I had previously built FicImage, a nifty application that elevates the reading experience of FicHub epubs by adding missing images. It required handling file creation and renaming, and that knowledge proved invaluable.

And so, CrossRename was born – a tool to simplify your life when managing files between Linux and Windows. No more naming hassles, just smooth, worry-free file management.

(back to top)

Contributing

Contributions are welcome! If you'd like to improve CrossRename or add support for other operating systems (like macOS), please feel free to submit a pull request.

(back to top)

Wait a minute, who are you?

Hello there! I'm Emmanuel Jemeni, and while I primarily work as a Frontend Developer, Python holds a special place as my first programming language. You can find me on various platforms:

(back to top)

License

MIT License

(back to top)

Changelog

Changelog

(back to top)