Skip to content

Instantly share code, notes, and snippets.

@RStrydom
Created November 24, 2014 09:44
Show Gist options
  • Select an option

  • Save RStrydom/a5f850b2bba96d8c2c17 to your computer and use it in GitHub Desktop.

Select an option

Save RStrydom/a5f850b2bba96d8c2c17 to your computer and use it in GitHub Desktop.

Revisions

  1. RStrydom created this gist Nov 24, 2014.
    10 changes: 10 additions & 0 deletions intoFolder
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    #!/bin/bash

    for FILE in `ls`
    do
    # remove the last dot and subsequent chars, then add new ext
    DIR="${FILE%%.*}"
    DIR=${DIR,,}
    mkdir -p "$DIR"
    mv "$FILE" "$DIR"
    done