Skip to main content
3 of 4
added 16 characters in body
Prvt_Yadav
  • 6k
  • 7
  • 39
  • 52

You can use:

for i in *.txt *.html
 do
  mv "$i" "${i%%.*}.directory/$i"
 done 

Run this in same directory where you are having files. It will remove trailing .txt and .html from file names and then will move files to destination directory.

Prvt_Yadav
  • 6k
  • 7
  • 39
  • 52