« Back to the main page

Language: Shell Script (Bash), Submitted: 6/25/10, Country: Canada - Raw | Download
# 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;