FTP 101 – Part 6: Get vs mget - what’s the difference?
Published {$created} by Carsten Blum
When working with FTP from the command line, two similar commands often cause confusion: get and mget.
They both download files from the server to your local machine – but the key difference is how many files they handle at once.
If you want to try out the commands in this tutorial, first you need to create an account with ftpGrid.
get – download a single file
The get command is used when you want to download one specific file from the current remote directory.
get report.csv
This will download report.csv from the server to your local working directory.
You can also specify a different local filename:
get report.csv local-report.csv
mget – download multiple files at once
The mget command stands for “multiple get” and is used to download several files matching a pattern, typically with wildcards. Example:
mget *.log
This command will attempt to download all .log files in the current directory.
For each file, the client will prompt you for confirmation before downloading:
mget server.log? y
mget errors.log? y
Tip: You can usually disable prompts by running prompt first:
prompt
mget *.log
Which one should you use?
Task | Use |
---|---|
Download a single file | get |
Download many files at once | mget |
Avoid confirmation prompts | prompt |
If you only need one specific file, get is cleaner.
If you’re backing up a folder or grabbing all files of a certain type, mget is your friend.
Bonus: Combine with cd, lcd, and ls
To make downloads easier, you can navigate folders like this:
cd /logs # change remote directory
lcd /home/user/logs # change local directory
ls # list files on remote
mget *.log # download them all
Summary
get is for single files
mget is for multiple files using wildcards
Use prompt to skip confirmations
Combine with cd and lcd for cleaner workflow
Next up: FTP 101 – Part 7: Uploading multiple files with put and mput.