I have been asked to put some order into a collection of documents.
Unfortunately - for me - the people who collected these documents
together had no real idea of document management and so they were all
dumped into three directories, each with well over a thousand files in them.
There is a small ray of light which means that I hopefully won't have to
trawl through each individual file to complete this job. Most (but not
all) of the files have a keyword in their filename and I can classify
them into appropriate directories according to this keyword. I can
easily extract a list of files with any given keyword with
ls -al | grep -i 'keyword'
but my question is this - how can I pipe the output of the above command
to a cp or mv command to only copy/move those files to the desired
directory?