Bootstrap FreeKB - FTP and Secure FTP (FTPS, SFTP) - download multiple files or directories using the mget command
FTP and Secure FTP (FTPS, SFTP) - download multiple files or directories using the mget command


There are a number of ways to securely transfer files between systems.

  • The PSFTP command line tool can be used to for SFTP (Secure FTP) to securetly transfer files between systems, from a remote system to your PC, or vice versa. This has the advantage of being able to transfer files between Linux, Mac and Windows systems.
  • The scp command (Secure Copy Protocol) could be used to securely transfer files between Linux systems.

There are a number of different tools that can be used to connect to an FTP / FTPS / SFTP server.

  • Windows or Linux command line prompt
  • Scripting tool (e.g. Bash, Perl, PowerShell, Python, et cetera)
  • The PSFTP command line tool PSFTP.exe (see Installing PuTTY PSFTP)

Use the lpwd (local present working directory) command to determine your current working directory on your local PC (not on the remote FTP system).

ftp> lpwd
Current local directory is C:\Program Files (x86)\PuTTY

 

If you need to change your local working directory, use the lcd (local change directory) command to move into the C:\Users\john.doe directory on your local PC (not on the remote FTP system).

ftp> lcd C:\Users\john.doe
New local directory is C:\Users\john.doe

 

Use the pwd (remote present working directory) command to determine your current working directory on the remote FTP system (not on your local PC).

ftp> pwd
Remote directory is /home/john.doe

 

If you need to change the working directory on the remote FPT system, use the cd (change directory) command.

ftp> cd /tmp
Remote directory is now /tmp

 

Use the get command to transfer the file from the remote system to your present working directory (pwd) on your local PC.

ftp > get foo.txt
local: foo.txt => remote:/tmp/foo.txt

 

Or, the mget command can be used to transfer multiple files from the remote system to your present working directory (pwd) on your local PC.

ftp > mget foo.txt bar.txt
local: foo.txt => remote:/tmp/foo.txt
local: bar.txt => remote:/tmp/bar.txt

 

The wildcard character can be used to transfer every file in the working directory on the remote system to your present working directory (pwd) on your local PC.

ftp > mget *
local: foo.txt => remote:/tmp/foo.txt
local: bar.txt => remote:/tmp/bar.txt

 

Use the exit command to disconnect.

ftp > exit

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter ee4582 in the box below so that we can be sure you are a human.