I want to run the following command
./mc cp --recursive local//first/second remote//first/second
I want to loop through local//first and find all directories and run ./mc cp for each directories
How can I do this?
If local//first only contains directories, this should work for you:
./mc cp -r local//first/* remote//first
For a general case you can also use find to list all directories:
find local//first -type d
Then do whatever with this list using -exec or pipe it into xargs:
find local//first -type d -path "local//first/*" -prune -exec ./mc cp --recursive {} remote//first \;
cp --recursive //first remote//first? The whole point of recursive is that it goes recursively through all intries below the starting directory. No need ot write a loop then.cpit is./mc cp