This command iterate over all PDF files, create a folder with same name of file and move the file to inside.
for i in *.pdf; do folderName=`echo "$i"|cut -d- -f1`; mkdir -p "$folderName"; mv "$i" "$folderName"; done
for i in *.pdf; do folderName=`echo "$i"|cut -d- -f1`; mkdir -p "$folderName"; mv "$i" "$folderName"; done
You can use for PDF or other extension file, just change *.pdf to *.doc, or *.jpg, ...
No comments :
Post a Comment