title: Copy files from a folder in a directory to a new folder
body: <ul>
  <li><p>I want to copy files from one folder to another folder, I have files in binary data, txt files and etc in a folder. </p></li>
  <li><p>But for example my files are stored in a folder1 lets say the script should make a newfolder with the name folder2 </p></li>
  </ul>
  
  <p>I have tried with the following code but I didnt succeed </p>
  
  <pre><code>#!/usr/bin/env bash
  
  for file in /home/mj/New Folder/*inp
      name="$(basename "$file" .inp)"
  
  for file in ~/home/mj/New Folder/*coor
      name="$(basename "$file".dcd)"
  
  
  for file in ~/home/mj/New Folder/*pdb
      name="$(basename "$file".coor)
  
  
  mkdir -p /home/mj/New Folder/"$name"
  
      cp "$file" "/home/mj/New Folder/"$name"
  
  done
  </code></pre>