---
title: "Using wget to Clone a Website on Linux"
url: https://www.geekcorelab.cn/en-US/post/using-wget-to-simulate-websites-under-linux
updated: 2026-11-04T02:24:14.710755Z
author: "hhjmk"
summary: "wget命令用于从指定URL下载文件，具有稳定性和适应性强的特点。在网络条件不佳或不稳定的情况下，wget能够持续尝试下载直至完成。若下载过程中被服务器中断，wget会自动重新连接并从断点继续下载。这一功能特别适用于从限制链接时间的服务器下载大文件。命令参数包括递归下载、转换链接、获取页面必需元素、不追溯父级目录等，并可支持断点续传和生成日志文件。"
---

# Using wget to Clone a Website on Linux

Run command
----

```
 wget -r -p -np -k me.gqink.cn

```

Parameter description
----

```
-r --recursive（递归） specify recursive download.（指定递归下载）
-k --convert-links（转换链接） make links in downloaded HTML point to local files.（将下载的HTML页面中的链接转换为相对链接即本地链接）
-p --page-requisites（页面必需元素） get all images, etc. needed to display HTML page.（下载所有的图片等页面显示所需的内容）
-np --no-parent（不追溯至父级） don't ascend to the parent directory.
这里写代码片额外参数：
-nc  断点续传
-o   生成日志文件

```

Run test
----

![Command](/uploads/import-placeholder/46)

![Run result](/uploads/import-placeholder/345)

![File](/uploads/import-placeholder/199)
The wget command is used to download files from a specified URL. wget is very stable and highly adaptable to narrow bandwidth and unstable networks. If a download fails due to network issues, wget keeps trying until the entire file is downloaded. If the server interrupts the download process, it reconnects to the server and resumes from where it stopped. This is very useful for downloading large files from servers that limit connection time.
