title: Program that removes all files accept txt files in folder
body: <p>Takes 2 arguments , source &amp; destination and removes all files except txt.
  .Im just learning bash so not used/aware of the different functions etc...</p>
  
  <pre><code>mkdir $2
  cp -R $1/* $2
  
  for file in $1/*;do #all files in testInput
     if [ -d "$file" ] #if its a file then look at the contents of it
     then
        for inDir in $file/*; do
           if [ -d "$inDir" ]
           then
              for line in $inDir ; do
                 if [ line != *.txt ]
                 then
                    rm line
  
                 fi
              done
            fi
         done
  
      else
         for files in file; do
            if [ files != *.txt ]
            then
               rm files
            fi
         done
  
      fi     
  done
  </code></pre>
  
  <p>source is a folder which contains the 3 folders and some of these subfolder contain a subfolder and files </p>