KandZ – Tuts

We like to help…!

Linux CLI 32 🐧 ftp and wget commands

a - ftp command

ftp connects to a remove server using FTP protocol
After the connection the FTP interface is initiated.
The interface has commands that you can use to manage or transfer files to the remote system
ftp 52.175.95.215 → connects to remote server
if it does not have an anonymous login, then it will ask for name and password
help → will display all supported commands
exit → logs off the remote server
common commands: cd, cdup, delete, idle, image, lcd mdir, mget, put


b - ftp examples

get filename /local/path/to/save/file → downloads a file
put /local/path/to/save/file filename → uploads a file
delete filename → deletes a files
mdelete file1 file2 file3 → deletes multiple files
mkdir directoryName → creates a directory
mget file1 file2 file3 → downloads multiple files
mput file1 file2 files → uploads multiple files
rename old new → renames a file


c - wget command

wget is used to download files from a server
It supports FTP, HTTP and HTTPS protocols
wget 'http://example.com/file' → downloads a file
you can change the name by adding -O localfile1.txt
wget -c 'http://example.com/file' → resumes to download a file if it failed
wget --http-user=username --http-password=password http://example.com/file.txt → provides authentication credentials
common options: -b → downloads in the background -r → recursive
-i filename → reads urls from file -w 5 → waits for 5 secs between downloads

Leave a Reply