Simple scp memory method and simple scp memory method
Scp can only send the text view to the remote and copy files from the remote, but it is often used to mix the two functions first, so I have summarized it in plain vernacular and it is very easy to remember. Here I will share with you.
Two common features of scp:
(1) send the text view to the remote end
The absolute path of the scp file to be sent. root @ Remote Server URL: file storage path
Scp log/* zhangxl@172.168.10.7:/home/zhangxl/aaa/here because it is to send to my personal server, so change root to my personal server name,
Note: to send to the remote end, you must first know the path of the file on your machine. If you do not even know the path, how can you send it? Then, the remote host name (usually root), ip address, and path for storing files are known.
(2) copy files from the remote end
Scp (User Name) @ Remote Server URL: copy file absolute path storage path scp-r lib@172.168.10.7 :~ /Tmp /*~ /Aaa /~ /Aaa/is equivalent to/home/zhangxl/aaa/-r recursively traversing sub-Directories, you need to know the absolute path of the Host Name, ip address, and file, and then the path for storing the file.