Score:0

wget download file to inurl directory

de flag

Is there any way to download file to inurl directory.

For example: Here the url is https://url.com/api/discovery/manifest

I want the download structure be like

root_folder
- api
-- discovery
---- manifest

is there any command to automate this, I know I can enter the directory manually like wget -P api/discovery

David avatar
cn flag
If this is a Ubuntu question where is the server type and version number of the OS?
Score:0
bf flag

The question is not the clearest, but here is my interpretation of it.

You want to take the filepath from the url https://url.com/api/discovery/manifest

you can do that with (after the last . from /)

string='https://url.com/api/discovery/manifest' && fileloc=${string##*.} && fileloc='/'${fileloc#*/}

fileloc contains /api/discovery/manifest

To save to root you need sudo, it is better if you save it in your user home

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.