How to download files in Linux
Generally, the wget command is used to download files in Linux, and you can install them through the package management tool
yum install wget -y apt install wget -y
wget is a commonly used free tool under Linux that automatically downloads files from the Internet. It supports HTTP, HTTPS and FTP protocols and can use HTTP proxy. The general usage method is: wget space parameter is the url path of the file to be downloaded, for example:
wget http://www.linuxsense.org/xxxx/xxx.tar.gz
-c parameter. This is also very common. You can resume the download from a breakpoint. If it is accidentally terminated, you can continue to use the command. Then download, for example:
wget -c http://www.linuxsense.org/xxxx/xxx.tar.gz
Wget common parameters
-b: background download, Wget defaults to download the file to the current directory.
-O: Download the file to the specified directory.
-P: Create a directory with the specified name before saving the file.
-t: Number of connection attempts, how many times Wget attempts to connect when it cannot establish a connection with the server.
-c: Resume the download from the breakpoint. If the download is interrupted, the download will start from the last breakpoint when the connection is restored.
-r: Use recursive download
Recommendation: Linux system entry learning
The above is the detailed content of How to download files in linux. For more information, please follow other related articles on the PHP Chinese website!