April 4, 2015

How to copy a file from a directory to another directory?

Use the cp command...

Use the cp command
> cp /source/dir/file /target/dir
Want to also preserve the file attributes?
> cp -p /source/dir/file /target/dir
cp clobbers targets by default: turn it off?
> cp -n /source/dir/file /target/dir
or get interactive prompt to overwrite
> cp -i /source/dir/file /target/dir

Alternative: use rsync

> rsync /source/dir/file /target/dir
[ many options: try -i, --progress, --size-only, -n (VITAL!) etc..]
Like  (1 like)
Click Here!