{
    "content": [
        {
            "type": "text",
            "text": "# rename (perldoc)\n\n## TLDR\n\n> Rename a file or group of files with a `regex`.\n\n- Replace `from` with `to` in the filenames of the specified files:\n  `rename 's/{{from}}/{{to}}/' {{*.txt}}`\n- Dry-run - display which changes would occur without performing them:\n  `rename -n 's/{{from}}/{{to}}/' {{*.txt}}`\n- Change the extension:\n  `rename 's/\\.{{old}}$/\\.{{new}}/' {{*.txt}}`\n- Change to lowercase (use `-f` in case-insensitive filesystems):\n  `rename {{-f|--force}} 'y/A-Z/a-z/' {{*.txt}}`\n- Capitalize first letter of every word in the name:\n  `rename {{-f|--force}} 's/\\b(\\w)/\\U$1/g' {{*.txt}}`\n- Replace spaces with underscores:\n  `rename 's/\\s+/_/g' {{*.txt}}`\n\n*Source: tldr-pages*\n\n---\n\n## Full Content\n\n"
        }
    ],
    "structuredContent": {
        "command": "rename",
        "section": "-f",
        "mode": "perldoc",
        "summary": null,
        "synopsis": null,
        "tldr_summary": "Rename a file or group of files with a `regex`.",
        "tldr_examples": [
            {
                "description": "Replace `from` with `to` in the filenames of the specified files",
                "command": "rename 's/{{from}}/{{to}}/' {{*.txt}}"
            },
            {
                "description": "Dry-run - display which changes would occur without performing them",
                "command": "rename -n 's/{{from}}/{{to}}/' {{*.txt}}"
            },
            {
                "description": "Change the extension",
                "command": "rename 's/\\.{{old}}$/\\.{{new}}/' {{*.txt}}"
            },
            {
                "description": "Change to lowercase (use `-f` in case-insensitive filesystems)",
                "command": "rename {{-f|--force}} 'y/A-Z/a-z/' {{*.txt}}"
            },
            {
                "description": "Capitalize first letter of every word in the name",
                "command": "rename {{-f|--force}} 's/\\b(\\w)/\\U$1/g' {{*.txt}}"
            },
            {
                "description": "Replace spaces with underscores",
                "command": "rename 's/\\s+/_/g' {{*.txt}}"
            }
        ],
        "tldr_source": "official",
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [],
        "sections": []
    }
}