I am using a command similar to this one:
find . -name \"*.php\" -exec chmod 755 {} \\;
Although, I am not using chmod, I am using a differ
You can chain multiple -exec
commands with a single find command. The syntax for that is:
find . -exec cmd1 \; -exec cmd2 \; -exec cmd3 \;
which in your case would look like this:
find . -name '*.php' -exec chmod 755 {} \; -exec echo '+' \;
Although you have a few other options for this. You can redirect output to a file:
find . -name '*.php' -exec chmod 755 {} \; > logfile.txt
Or, you can use tee
, which will allow you to write the output to a logfile, and still output to the screen. I find this useful, as the continuously-streamed output to the screen lets me know that the command is still running (not crashed or hung), and I still have the log file to refer to later.
find . -name '*.php' -exec chmod 755 {} \; | tee logfile.txt
wc -l logfile.txt // prints the lines in the file
grep -c '^+$' logfile.txt // prints the lines containing a single '+'