User Tools

Site Tools


ubuntu:find:run_one_or_more_commands_for_each_of_finds_results

This is an old revision of the document!


Ubuntu - Find - Run one or more commands for each of finds results

To run a single command for each file found:

find dirname ... -exec somecommand {} \;

To run multiple commands in sequence for each file found, where the second command should only be run if the first command succeeds:

find dirname ... -exec somecommand {} \; -exec someothercommand {} \;

To run a single command on multiple files at once:

find dirname ... -exec somecommand {} +

References

ubuntu/find/run_one_or_more_commands_for_each_of_finds_results.1654771837.txt.gz ยท Last modified: 2022/06/09 10:50 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki