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
Joining Line Breaks in Fasta File with Condition in Sed/Awk/Perl One-Liner
How to Convince Z/Os Scp to Transfer Binary Files
Socket Getting Created with Same Ip and Port on Local Host
Window Placement: Winsplit Revolution -Like Application for Linux (Kde)
How to Pass Input to a Running Service or Daemon
Safer Alternative to Matlab's 'system' Command
Recording from Alsa - Understanding Memory Mapping
Deleting Content of Folder with Shell Script
How to Configure Gitlab as a Subdomain in Nginix.Conf
Cross-Compilation to X86_64-Unknown-Linux-Gnu Fails on MAC Osx
Get .Net Core Dll Version on Linux
Chmod a Freshly Mounted External Drive to Set Up Writing Access
Why Does Wget Output to Stderr Rather Than Stdout
How to Ping Other Containers in a Docker Network Through Their Hostname
What Server-Side Web Technology Should I Use in an Embedded System
How to Use Ptrace(2) to Change Behaviour of Syscalls
Make Bash Differentiate Between Ctrl-<Letter> and Ctrl-Shift-<Letter>