I need to select files which contain "Error" or "traffic" in their names, e.g.
abc_ERRor.csv raError.csv bsn_Error.csv bbbctraffic.csv ccc_traffic.csv ... and move them into corresponding directories like Error_directory and traffic_directory according to their names.
I tried this but it didn't work
mv $(ls test_file | grep -l 'Error>' *) Error_directory How can I do this from the command-line?
ls test_file | grep 'Error'
grepis irrelevant here. Start with the task, and then determine the tools, and try to avoid using Unix commands as verbs unless that is exactly what you mean.