lets say I want to copy a list of files to another directory
-rw-rw---- Sep 1 11:06 File1.txt
-rw-rw---- Sep 1 11:06 File101.txt
-rw-rw---- Sep 3 11:06 File2.txt
-rw-rw---- Sep 4 11:06 File303.txt
I would like to grep all the files that have a Sep 1 in there
ls -lrt | grep 'Sep 1'
and try to pass it to cp as an argument
cp `ls -lrt | grep 'Sep 1'` /directory/
or
cp $(ls -lrt | grep 'Sep 1') /directory/
with the second option i that is an illegal variable name can you please help me with this?