# one line command to create a directory from a filename and move that file into the newly created directory. # (works in the present working directory) for i in *; do mkdir ${i%.*}; mv $i ${i%.*}; done;