Shell Script to Check Ubuntu Version and Then Copy Files

find and copy file using Bash

I would recommend using find's -exec option:

find . -ctime 15 -exec cp {} ../otherfolder \;

As always, consult the manpage for best results.

Shell script to copy files from one location to another location and rename add the current date to every file

In bash, provided you files names have no spaces:

cd /home/webapps/project1/folder1
for f in *.csv
do
cp -v "$f" /home/webapps/project1/folder2/"${f%.csv}"$(date +%m%d%y).csv
done

Shell Script (Linux): Copy and overwrite only files that have changed in destination?

rsync can do this:

rsync -av source/ destination/ 

This command will also print out the list of files that have been replaced.



Related Topics



Leave a reply



Submit