I'm trying to move files from Terminal but only those from the results of a grep
query.
ls -l | grep -i s02 | mv
What is the best way to complete the command above?
command lineterminalunix
I'm trying to move files from Terminal but only those from the results of a grep
query.
ls -l | grep -i s02 | mv
What is the best way to complete the command above?
Best Answer
You can accomplish this by just running
For more complex operations there is also the option to use
find
to find all relevant files. The example from your question could also be written asIt's worth to have a look at
man find
to see which other options are available.