Tag Info

New answers tagged

0

cp -u According to the cp man page, -u will only overwrite file if the destination is older than the source. It appears the -u option is not available for scp, so if you need to do it on a remote host, use rsync. By default, rsync skips files that have the same size, name, and last modified time. Rsync also has a -u option to skip destination files that ...


0

Use rsync rsync --progress -r -u /from/one/* /to/another/directory


-1

for K in $(seq -f "test_%200g" 365); do cp *_${K}.* "/data/$K" 2>/dev/null; done From what I've found out, it appears that in the "seq" command, the '%2' represents an integer and each '0' represents a place, i.e. ones, tens. The 'g' closes the expression. I may be wrong, but it works! Thanks for the help!


0

Something like this should work for K in $(seq -w 1 365) do mv *_${K}.* "/data/$K" 2>/dev/null done


3

Use brace expansion, like - $cp ./01_reliefs/*.\{jpg,png,tif} ../output/


0

This might also work cd your_directory cp -rp * /absolut_path_to_parent_directory


0

Try: find . -type d -regex './[a-z]*' -exec bash -c "cp -v {}/* .." \; Discussion Consider: find . -type d -regex './[a-z]*' -exec cp -v {}/* .. \; When bash sees this line, it performs pathname expansion on {}/*. Since there is no directory named {}, the * is left as a literal *. This is not what you want. You need pathname expansion to occur ...



Top 50 recent answers are included