← 返回命令列表

Linux command

httrack 命令

网络

复制后可按需替换文件名、目录或参数。

常用示例

Mirror a website

httrack [https://example.com]

Mirror a website

httrack [https://example.com] -O [path/to/output]

Mirror a website

httrack [https://example.com] -r[3]

Continue an interrupted download

httrack --continue

Update an existing mirror

httrack --update

Mirror a website

httrack [https://example.com] -P [proxy:8080]

Mirror only specific file types

httrack [https://example.com] +*.pdf +*.jpg -*

Limit download speed

httrack [https://example.com] -A[102400]

说明

httrack is a website copier that downloads websites to a local directory for offline browsing. It preserves the original site structure, converting links to work locally. The mirrored site can be browsed offline using any web browser. The tool follows links to specified depths, downloads files, and reconstructs relative paths. It supports HTTP and HTTPS protocols, authentication, cookies, and proxy servers. Filters control which files are downloaded using wildcard patterns. HTTrack can update previously mirrored sites, downloading only changed files. It handles interrupted downloads gracefully with the continue option. The webhttrack command provides a browser-based graphical interface.

参数

-O, --path _PATH_
Output/project path
-w, --mirror
Mirror websites (default mode)
-W, --mirror-wizard
Mirror websites with interactive wizard
-g, --get-files
Get files without mirroring structure
-i, --continue
Continue an interrupted download
-r _N_, --depth _N_
Set link depth limit (default: unlimited for mirror mode)
-m _N_, --max-files _N_
Maximum number of files to download
-M _N_, --max-size _N_
Maximum total size in bytes
-E _N_, --max-time _N_
Maximum mirror time in seconds
-A _N_, --max-rate _N_
Maximum transfer rate (bytes/second)
-c _N_, --sockets _N_
Number of simultaneous connections
-T _N_, --timeout _N_
Connection timeout in seconds
-R _N_, --retries _N_
Number of retry attempts
-P, --proxy _HOST:PORT_
Use proxy server
-K _N_, --keep-links _N_
Keep original link format (0=relative, 2=absolute)
-x, --replace-external
Replace external links with error page
-n, --near
Get non-HTML files near links
-t, --test
Test links only, do not download
-q, --quiet
Quiet mode, no output
-v, --verbose
Verbose output
-s0, --robots=0
Ignore robots.txt
-F _STRING_
Set the User-Agent header for HTTP requests
-N _N_
Structure type for saved files naming convention
-%c _N_
Maximum number of connections per second

FAQ

What is the httrack command used for?

httrack is a website copier that downloads websites to a local directory for offline browsing. It preserves the original site structure, converting links to work locally. The mirrored site can be browsed offline using any web browser. The tool follows links to specified depths, downloads files, and reconstructs relative paths. It supports HTTP and HTTPS protocols, authentication, cookies, and proxy servers. Filters control which files are downloaded using wildcard patterns. HTTrack can update previously mirrored sites, downloading only changed files. It handles interrupted downloads gracefully with the continue option. The webhttrack command provides a browser-based graphical interface.

How do I run a basic httrack example?

Run `httrack [https://example.com]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -O, --path _PATH_ do in httrack?

Output/project path