Background: While using MobXterm SFTP to upload large files, I faced a problem where files larger than 64GB stopped uploading once they reached that limit. So I switched to using the SCP command in the Windows command line. Indeed, sometimes the most basic tools work best, haha…
To upload and download files or folders to a Linux system from the Windows command line, you can use the SCP command. SCP stands for Secure Copy Protocol, which allows file transfer between local and remote hosts over the SSH protocol.
Here are the steps for uploading and downloading files or folders:
Uploading Files or Folders
Uploading a Single Local File
- Open the Windows command line and enter the following command:
|
|
Here, <file_path>
is the path of the file or folder you want to upload, <username>
is the username for the Linux system, <linux_ip>
is the IP address of the Linux system, and <remote_path>
is the target path on the Linux system.
For example, to upload the local file example.txt
to the /home/user
directory on the Linux system, you can enter the following command:
|
|
Uploading a Whole Local Folder
To upload a folder, you can use the -r
option, like this:
|
|
- Enter the password for the Linux system and press Enter.
- SCP will automatically upload the file or folder to the specified directory on the Linux system.
Download Operations
Downloading a Single File
- Open the Windows command line and enter the following command:
|
|
Here, <username>
is the username for the Linux system, <linux_ip>
is the IP address of the Linux system, <remote_path>
is the path to the file or folder on the Linux system, and <local_path>
is the path where you want to save the file or folder locally.
For example, to download the file /home/user/example.txt
from the Linux system to the C:\Users\user\Documents
directory on your local machine, you can enter the following command:
|
|
Downloading an Entire Folder
If you want to download a folder, you can also use the -r
option, like this:
|
|
- Enter the password for the Linux system and press Enter.
- SCP will automatically download the file or folder to the specified local directory.