{"id":13446795,"url":"https://github.com/benlinton/slugify","last_synced_at":"2025-10-21T04:52:28.687Z","repository":{"id":50370809,"uuid":"4279854","full_name":"benlinton/slugify","owner":"benlinton","description":"Bash command that converts filenames and directories to a web friendly format.","archived":false,"fork":false,"pushed_at":"2022-03-02T09:41:36.000Z","size":11,"stargazers_count":313,"open_issues_count":4,"forks_count":33,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-25T17:03:04.443Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Groff","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/benlinton.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}},"created_at":"2012-05-10T03:25:09.000Z","updated_at":"2025-09-25T04:10:15.000Z","dependencies_parsed_at":"2022-08-12T21:11:25.398Z","dependency_job_id":null,"html_url":"https://github.com/benlinton/slugify","commit_stats":null,"previous_names":["benlinton/bash-slugify"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/benlinton/slugify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benlinton%2Fslugify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benlinton%2Fslugify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benlinton%2Fslugify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benlinton%2Fslugify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benlinton","download_url":"https://codeload.github.com/benlinton/slugify/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benlinton%2Fslugify/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280207189,"owners_count":26290616,"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","status":"online","status_checked_at":"2025-10-21T02:00:06.614Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-07-31T05:01:00.135Z","updated_at":"2025-10-21T04:52:28.666Z","avatar_url":"https://github.com/benlinton.png","language":"Groff","readme":"# Bash Command: Slugify\n\nSlugify is a bash command that converts filenames and directories to a web friendly format.\n\n## Usage Help\n\nSimply enter the slugify command without any arguments or with the -h option to view the usage help.\n\n    $ slugify\n    usage: slugify [-acdhintuv] source_file ...\n       -a: remove spaces immediately adjacent to dashes\n       -c: consolidate consecutive spaces into single space\n       -d: replace spaces with dashes (instead of default underscores)\n       -h: help\n       -i: ignore case\n       -n: dry run\n       -t: treat existing dashes as spaces\n       -u: treat existing underscores as spaces (useful with -a, -c, or -d)\n       -v: verbose\n\n## Usage Examples\n\nNote, most examples below are run in verbose mode (-v) to help illustrate the results.\n\nVerbose mode is unnecessary in real world scenarios.\n\n#### Provide escaped filenames:\n\n    $ slugify -v My\\ \\ file.txt\n    rename: My  file.txt -\u003e my__file.txt\n\n#### Alternatively provide unescaped filenames inside quotes:\n\n    $ slugify -v \"My  file.txt\"\n    rename: My  file.txt -\u003e my__file.txt\n\n#### Globs (like * and ?) work as well:\n\n    $ slugify -v *.txt\n    rename: My file.txt -\u003e my_file.txt\n    ignore: my_web_friendly_filename.txt\n\n#### Provide an unlimited number of arguments:\n\n    $ slugify -v \"My first file.txt\" \"My second file.txt\"\n    rename: My first file.txt -\u003e my_first_file.txt\n    rename: My second file.txt -\u003e my_second_file.txt\n\n#### Directories are also supported:\n\n    $ slugify -v \"My Directory\"\n    rename: My Directory -\u003e my_directory\n\n#### Consolidate consecutive spaces into single spaces:\n\n    $ slugify -vc \"My    consolidated    file.txt\"\n    rename: My    consolidated    file.txt -\u003e my_consolidated_file.txt\n\n#### Replace spaces with dashes:\n\n    $ slugify -vd \"My dashed file.txt\"\n    rename: My dashed file.txt -\u003e my-dashed-file.txt\n\nThe -d option replaces each space with a dash.\n\n    $ slugify -vd \"My  dashed  file.txt\"\n    rename: My  dashed  file.txt -\u003e my--dashed--file.txt\n\nCombine -d with -c (consolidate spaces) for a single dash between each word.\n\n    $ slugify -vdc \"My  dashed  file.txt\"\n    rename: My  dashed  file.txt -\u003e my-dashed-file.txt\n\n#### Ignore case:\n\n    $ slugify -vi \"UPPER CASE FILE.txt\"\n    rename: UPPER CASE FILE.txt -\u003e UPPER_CASE_FILE.txt\n\n#### Play it safe with a dry run:\n\nDry run mode does not alter the filesystem in any way.\n\n    $ slugify -n *\n    --- Begin dry run mode.\n    rename: My file.txt -\u003e my_file.txt\n    ignore: web_friendly_filename.txt\n    --- End dry run mode.\n\nDry run mode also allows you to test filenames that don't exist. Great for testing!\n\n    $ slugify -n \"Ghost File.txt\"\n    --- Begin dry run mode.\n    not found: Ghost File.txt\n    rename: Ghost File.txt -\u003e ghost_file.txt\n    --- End dry run mode.\n\nDry run mode automatically enables verbose mode so there is no need to include the -v option with -n.\n\n#### Handle spaces adjacent to dashes:\n\nIn this example, without -a the dashes end up surrounded by underscores.\n\n    $ slugify -v \"The Beatles - Yellow Submarine.mp3\"\n    rename: The Beatles - Yellow Submarine.mp3 -\u003e the_beatles_-_yellow_submarine.mp3\n\nBut with -a the adjacent spaces are removed.\n\n    $ slugify -va \"The Beatles - Yellow Submarine.mp3\"\n    rename: The Beatles - Yellow Submarine.mp3 -\u003e the_beatles-yellow_submarine.mp3\n\nThe -a only removes spaces immediately adjacent to a dash, which may not be the desired effect (below three spaces on either side of the dash get converted into two underscores because of -a).\n\n    $ slugify -va \"The Beatles   -   Yellow Submarine.mp3\"\n    rename: The Beatles   -   Yellow Submarine.mp3 -\u003e the_beatles__-__yellow_submarine.mp3\n\nBut -c consolidates spaces into a single space and then -a will remove the left over adjacent single spaces.\n\n    $ slugify -vac \"The Beatles   -   Yellow Submarine.mp3\"\n    rename: The Beatles - Yellow Submarine.mp3 -\u003e the_beatles-yellow_submarine.mp3\n\n#### Convert existing underscores into dashes\n\nThe -u treats underscores as spaces and -d converts spaces into dashes.\n\n    $ slugify -vud \"Spaces Dashes-And_Underscores.txt\"\n    rename: Spaces Dashes-And_Underscores.txt -\u003e spaces-dashes-and-underscores.txt\n\n#### Convert existing dashes into underscores\n\n    $ slugify -vt \"Spaces Dashes-And_Underscores.txt\"\n    rename: Spaces Dashes-And_Underscores.txt -\u003e spaces_dashes_and_underscores.txt\n\n","funding_links":[],"categories":["Groff","Command-Line Productivity"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenlinton%2Fslugify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenlinton%2Fslugify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenlinton%2Fslugify/lists"}