≡ Menu

scp command

I am a new Linux user. I use scp to upload files to net-storage provided CDN company. I do not want to overwrite the existing files. How can I prevent overwriting of files when using scp command under Linux, Mac OS X or Unix like operating systems?
[click to continue…]

I do not want to start ssh-agent and ssh-add as described here to manage my ssh keys for password less login. How do I install keychain software to manage my keys running on a Debian or Ubuntu based cloud server?
[click to continue…]

Linux / Unix: scp Copy All Hidden Dot Files

I'm using scp command to copy files from one server to another server. The problem is that I'm unable to copy all hidden files (such as .bash_history). How do I copy hidden files using the scp command under Unix like operating systems?
[click to continue…]

How do I copy a file with a colon punctuation (:) name in it. When I type the following command to copy "file:name.txt" to a remote host called server1:

scp file:name.txt user@server1:/path

I get the following error:

ssh: Could not resolve hostname s: Name or service not known

How do I copy file with scp or rsync with a colon in it?
[click to continue…]

UNIX / Linux: Rsnapshot Restore Backups

I've created the backup server using this tutorial under Redhat and Debian Linux systems. How do I restore files (such as /var/www/html) with rsnapshot backup tool? How do I restore MySQL database dumps with rsnapshot under UNIX or Linux operating systems?
[click to continue…]

Linux / UNIX scp Copy Hidden . (Dot) Files

How do I copy all hidden files from $HOME using scp command line tool?
[click to continue…]

Q. How do I copy all the file including subdirectories from DVD disk mounted at /mnt/dvd to /home/tom at a shell prompt under CentOS Linux?

A. You need to use cp command to copy SOURCE to DESTINATION or multiple SOURCE(s) to a DIRECTORY. Gnu cp command has -a option which copy directories recursively while preserving the file attributes such as mode,ownership,timestamps and security contexts, if possible additional attributes such as links et all.

cp command syntax

Use the following syntax:
cp -a {/path/to/source} {/path/to/destination}

For example copy all files including subdirectories from /mnt/dvd/data to /home/tom/data, enter:
$ cp -a /mnt/dvd/data/* /home/tom/data
$ cp -av /mnt/dvd/data/* /home/tom/data

Recursively copy entire directories

Many other command (including cp) support -r or -R option for copying file recursively. For example scp secure network copy command:
$ scp -r *.cpp remote_user@server.nixcraft.in:~
OR use cp command locally (instead of -a option):
$ cp -r *.cpp /path/to/dest