Copying files and folders between Linux Server and Windows
Many a time you’ll find yourself wanting to copy some file or folder from your windows machine to a remote Linux server. Now, if you’re using GUI, you can just send the file to Drive and download it on the other side.
I, however, believe that it is the greatest taboo to use GUI on a Linux server. It has a terminal for a reason and that Terminal is all you ever need.
Now to access a Linux server from windows, you’ll need to have Putty installed. I am going to assume that you have it and can already SSH into your Linux machine. The task here is sending that file or folder to the Linux server.
Hit your windows search and search for pscp. Run the program and then open your command prompt.
To copy a file from your windows machine to the Linux box
Type the following command:
$pscp C:\Users\<user>\<filepath> <linuxusername>@<ip>:<save path>
You’ll have to replace <user>, <filepath>, <linuxusername>, <ip>, and <save path> with actual values e.g.
$pscp C:\Users\Patrick\Documents\test.txt patrick@192.168.0.50:/home/patrick/files
To copy a folder just use -R before specifying the folder path
To copy a file from Linux server to Windows:
$pscp <linuxuser>@<ip>:<filepath> C:\Users\<user>\<savepath>
Yes, It’s that easy! Now, you don’t have to keep on doing it the long and wrong way.