Created
December 18, 2013 06:09
-
-
Save secobi/8017974 to your computer and use it in GitHub Desktop.
recursively expanded directory tree view through bash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| #source http://stackoverflow.com/revisions/20620653/3 | |
| dir="/somedir/" | |
| for i in "$dir"*; do | |
| if [ -f "$i" ]; then | |
| filename="${i%%.*}" | |
| if [ ! -d "$filename" ]; then | |
| mkdir "$filename" | |
| fi | |
| mv "$i" "$filename" | |
| fi | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment