{"id":13994605,"url":"https://github.com/io12/unf","last_synced_at":"2025-07-22T19:32:56.034Z","repository":{"id":37546185,"uuid":"191659361","full_name":"io12/unf","owner":"io12","description":"UNixize Filename -- replace annoying anti-unix characters in filenames","archived":false,"fork":false,"pushed_at":"2023-04-07T05:03:46.000Z","size":461,"stargazers_count":57,"open_issues_count":6,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-05-01T14:35:29.756Z","etag":null,"topics":["cli","files","rust","shell","unix"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/io12.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2019-06-12T23:47:16.000Z","updated_at":"2024-01-18T10:23:52.000Z","dependencies_parsed_at":"2024-03-24T08:33:26.462Z","dependency_job_id":"288bddb2-b4ec-4325-9eca-9f670cbbdff0","html_url":"https://github.com/io12/unf","commit_stats":{"total_commits":384,"total_committers":5,"mean_commits":76.8,"dds":0.6302083333333333,"last_synced_commit":"ca2df47a9a2ac92cc441f402c35de5cfc7729e7b"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/io12%2Funf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/io12%2Funf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/io12%2Funf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/io12%2Funf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/io12","download_url":"https://codeload.github.com/io12/unf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227166819,"owners_count":17740986,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","files","rust","shell","unix"],"created_at":"2024-08-09T14:02:58.849Z","updated_at":"2024-11-29T16:31:37.550Z","avatar_url":"https://github.com/io12.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"[![crates.io](https://img.shields.io/crates/v/unf)](https://crates.io/crates/unf)\n[![tests](https://github.com/io12/unf/workflows/tests/badge.svg)](https://github.com/io12/unf/actions?query=workflow%3Atests)\n[![Coverage Status](https://coveralls.io/repos/github/io12/unf/badge.svg?branch=master)](https://coveralls.io/github/io12/unf?branch=master)\n\n# `unf`\n\nUNixize Filename -- replace annoying anti-unix characters in filenames\n\n## About\n\nCertain characters in filenames are problematic for command-line users. For example, spaces and parentheses are treated specially by the shell. `unf` renames these files, so you no longer have to be annoyed when your Windows-using friend sends you an irritatingly-named zip file.\n\n## Installing\n\n### Using `cargo`\n\n``` sh\ncargo install unf\n```\n\nThis installs to `~/.cargo/bin`, so make sure that's in your `PATH`.\n\n### Arch Linux\n\nInstall `unf` from the AUR.\n\n## Usage\n\n```\nunf [FLAGS] \u003cPATH\u003e...\n```\n\n`\u003cPATH\u003e...`: The paths of filenames to unixize\n\n`-r` `--recursive`: Recursively unixize filenames in directories. If some of the specified paths are directories, unf will operate recursively on their contents\n\n`-f` `--force` Do not interactively prompt to rename each file\n\n## Examples\n\n``` sh\n$ unf 🤔😀😃😄😁😆😅emojis.txt\nrename '🤔😀😃😄😁😆😅emojis.txt' -\u003e 'thinking_grinning_smiley_smile_grin_laughing_sweat_smile_emojis.txt'? (y/N): y\n```\n\n``` sh\n$ unf -f 'Game (Not Pirated 😉).rar'\nrename 'Game (Not Pirated 😉).rar' -\u003e 'Game_Not_Pirated_wink.rar'\n```\n\n### Recursion\n\n``` sh\n$ unf -rf My\\ Files/ My\\ Folder\nrename 'My Files/Passwords :) .txt' -\u003e 'My Files/Passwords.txt'\nrename 'My Files/Another Cool Photo.JPG' -\u003e 'My Files/Another_Cool_Photo.JPG'\nrename 'My Files/Wow Cool Photo.JPG' -\u003e 'My Files/Wow_Cool_Photo.JPG'\nrename 'My Files/Cool Photo.JPG' -\u003e 'My Files/Cool_Photo.JPG'\nrename 'My Files/' -\u003e 'My_Files'\nrename 'My Folder' -\u003e 'My_Folder'\n```\n\n### Collisions\n\n``` sh\n$ unf -f -- --fake-flag.txt fake-flag.txt ------fake-flag.txt ' fake-flag.txt' $'\\tfake-flag.txt'\nrename '--fake-flag.txt' -\u003e 'fake-flag_000.txt'\nrename '------fake-flag.txt' -\u003e 'fake-flag_001.txt'\nrename ' fake-flag.txt' -\u003e 'fake-flag_002.txt'\nrename '\tfake-flag.txt' -\u003e 'fake-flag_003.txt'\n```\n\n## FAQ\n\n### Is this useful?\n\nHopefully for some people. There are certain situations in which I believe this tool is useful.\n\n- Downloading files uploaded by non-CLI users, especially large archives with poorly-named files\n- The ` (1)` that gets appended to web browser download duplicates\n- Unix tools which take advantage of the loose Unix filename restrictions (like `youtube-dl`, which creates filenames from the video title)\n\n### How does this handle collisions?\n\nSince `unf` is an automatic batch rename tool, there may be cases where the path to the unixized filename already exists. `unf` resolves this crisis by appending and incrementing a zero-padded number to the end of the file stem. An example of this is displayed [here](#collisions).\n\n### Why is the collision-resolving number zero-padded?\n\nIt has the nice property of being ordered when using tools that sort filenames by ASCII values, such as `ls` and shell completion.\n\n### Why not just use shell completion to access problematic filenames?\n\nShell completion can automatically insert backslash escapes, but this is sub-optimal. The backslash escapes make the filenames substantially less readable. However, shell completion is great for invoking `unf`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fio12%2Funf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fio12%2Funf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fio12%2Funf/lists"}