Recently, I started exploring Ubuntu and found that using the command line for uploading and downloading is quite convenient. If you want to back up data locally, you can use the scp command. scp provides several options that can be added after scp.
> -p Preserve the timestamps of the source files when copying.
> -q Do not display any prompt messages during file copying.
> -r Copy the entire directory.
> -v Display prompt messages when copying files.
To download all files from the /home/adm/ directory on the remote host 192.168.1.23 to the local /home/sun/ directory, use the following command:
scp -r root@192.168.1.23:/home/adm/ /home/sun/
After pressing enter, enter the password and you're done.
PS: When transferring files with scp in Linux, you may encounter the error "scp: /usr/tools: not a regular file" which means the transfer was not successful.
Possible solutions:
- Check if you have the necessary permissions using chmod 777.
- Use the -r parameter when using scp.