When using wget, specify the download location by using the -P or --directory-prefix parameter, followed by the desired save path.
For example, if you want to download a file to the /home/username/downloads directory, you can use the following command:
bashwget -P /home/username/downloads http://example.com/somefile.zip
This command instructs wget to download the file from http://example.com/somefile.zip and save it in the /home/username/downloads directory.
Alternatively, you can use the full parameter name:
bashwget --directory-prefix=/home/username/downloads http://example.com/somefile.zip
This command serves the same purpose as the previous one but uses the full parameter name to specify the download directory, enhancing command readability.
These approaches are highly practical, especially when you need to organize downloaded files directly into specific directories.
2024年7月30日 00:17 回复