{"id":20652468,"url":"https://github.com/thesofakillers/dedirectorizer","last_synced_at":"2026-04-17T20:31:38.134Z","repository":{"id":70961816,"uuid":"170851782","full_name":"thesofakillers/dedirectorizer","owner":"thesofakillers","description":"Deep flattening of a directory","archived":false,"fork":false,"pushed_at":"2019-02-15T11:42:51.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-05-07T19:03:32.348Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thesofakillers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"publiccode":null,"codemeta":null}},"created_at":"2019-02-15T11:06:13.000Z","updated_at":"2021-02-09T17:36:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"1c9eb78b-564e-48d8-b486-90234b7e0e43","html_url":"https://github.com/thesofakillers/dedirectorizer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/thesofakillers/dedirectorizer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thesofakillers%2Fdedirectorizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thesofakillers%2Fdedirectorizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thesofakillers%2Fdedirectorizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thesofakillers%2Fdedirectorizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thesofakillers","download_url":"https://codeload.github.com/thesofakillers/dedirectorizer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thesofakillers%2Fdedirectorizer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31944958,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T17:29:20.459Z","status":"ssl_error","status_checked_at":"2026-04-17T17:28:47.801Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-11-16T17:35:07.116Z","updated_at":"2026-04-17T20:31:38.112Z","avatar_url":"https://github.com/thesofakillers.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dedirectorizer\n\nA very simple bash script used to copy the contents of a directory in a manner such that subdirectories are eliminated but the structure is preserved via the naming. Perhaps better understood via illustration\n\n*Original Folder*\n```bash\n├── dir1\n│   ├── file1\n│   └── subdir1\n│       └── file2\n├── dir2\n│   └── file2\n├── file4\n└── dir3\n    └── subdir2\n        ├── subsubdir1\n        │   └──file6\n        └── file5\n```\nis copied as\n\n*dedirectorized Folder*\n```bash\n├── dir1.file1\n├── dir1.subdir1.file2\n├── dir2.file2\n├── file4\n├── dir3.subdir2.subsubdir1.file6\n├── dir3.subdir2.file5\n```\n\n## Usage\n\nThere are two ways of utilizing this script. Both ways require you to download [dedirectorize.sh](./dedirectorize.sh) to your machine.\n\n### Option 1 - Use within the folder\nPlace [dedirectorize.sh](./dedirectorize.sh) into the directory you wish to dedirectorize. Then in a terminal open in that specific directory, type\n```bash\nbash dedirectorize.sh\n```\nA directory named ```dedirectorized``` should appear containing the output described above.\n\n### Option 2 - Use within any folder\nYou may wish to be able to call dedirectorize.sh from any directory without having to move [dedirectorize.sh](./dedirectorize.sh) to the desired directory each time. \nTo achieve this, \n\n  1. create a directory called ```bin``` in your ```$HOME``` directory. ```mkdir -p $HOME/bin``` should be sufficient.\n  2. Place [dedirectorize.sh](./dedirectorize.sh) in into it so that you have ```$HOME/bin/dedirectorize.sh```. \n  3. Depending on your system edit your ```.bashrc``` or ```.bash_profile``` file so to include the line ```export PATH=\"$HOME/bin:$PATH\"```\n  4. Make [dedirectorize.sh](./dedirectorize.sh) executable by entering ```chmod +x $HOME/bin/dedirectorize.sh``` into the terminal\n  \nYou should now be able to write ```dedirectorize.sh``` into any terminal directory and succesfully run the script.\n\n## Why?\n\nFor a certain university assignment, I was asked if I could share my project files on the university portal as I made progress throughout. On my machine, my project files were neatly organized in directories, subdirectories etc. The university portal fileshare system however did not support the creation of folders. As such I decided to embed my project directory structure into the filenames to make the organization clear on the portal despite the lack of folders. \n\nNB: I of course considered simply using a .zip file but opted not to as this would require me to re-upload my entire project each time I decided to update the university portal fileshare.\n\nThis is also truly my first custom bash script (so may be not that good/smart) as I wanted to learn/get better at this particular topic\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthesofakillers%2Fdedirectorizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthesofakillers%2Fdedirectorizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthesofakillers%2Fdedirectorizer/lists"}