I have a number of files in a directory that can be grouped with something like "ls | grep SH2". I would like to move each file in this list to another directory.
Thanks
I have a number of files in a directory that can be grouped with something like "ls | grep SH2". I would like to move each file in this list to another directory.
Thanks
mv `ls | grep SH2` another_directory
for i in $(ls | grep SH2)
do
mv $i /new_path/
done
Equally bad:
$ ls -d *SH2* | xargs -I{} mv {} some_directory
Thanks to all!