Tag Info

New answers tagged


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 ...


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


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!


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


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


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


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