Mac realizes file interaction (upload and download) between terminal and server

The Mac comes with SSH, as explained in the last post.
This article mainly introduces the use of SCP command to achieve the file upload and download
1. Download files from the server
SCP username @ servername:/path/filename/Users/MAC/Desktop (local directory)
For example: SCP [email protected]:/root/test. TXT/Users/MAC/Desktop
Download /root/test.txt from the server to the local /Users/ MAC /Desktop directory.
Notice the space between the two addresses!
2. Upload files locally to the server
scp /path/filename [email protected]:/path ;
For example: SCP/Users/MAC/Desktop/test. TXT [email protected]:/root /
3. Download the entire directory from the server
Scp-r [email protected]:/root/ (remote directory) /Users/ MAC /Desktop (local directory)
For example: scp-r [email protected]:/root/ /Users/ MAC /Desktop/
4. Upload the directory to the server
scp -r local_dir [email protected]:remote_dir
For example, scp-r test [email protected]:/root/ Upload the test directory in the current directory to the server’s /root/ directory
5. Finally, it introduces a software that can also easily realize the file interaction between local and server. FinalShell

Read More: