Why does wget say “No such file or directory” when saving with -O?

0
15
Asked By MellowCactus42 On

I'm trying to download a file with wget and choose the output filename instead of using the long URL as the filename. I ran `wget -O ~/Downloads/file.flatpak "https://website.com/file-get.py?ident=superlongstringofcharacters&file=morebullshit.flatpak&evenmore=bullshit"`, but wget returned `/home/user/Downloads/file.flatpak: No such file or directory`. I assumed wget would create the Downloads folder if it didn't already exist. What am I doing wrong?

2 Answers

Answered By QuietHarbor19 On

You can create the directory first with `mkdir -p ~/Downloads`, then run wget again. Use `~/Downloads/file.flatpak` with the tilde unescaped so the shell expands it to your home directory.

Answered By BriskPiano7 On

wget will create the output file, but it won’t create missing parent directories. Make sure `/home/user/Downloads` already exists. Also, directory names are case-sensitive, so `Downloads` and `downloads` are different.

MellowCactus42 -

That was it—the Downloads folder didn’t exist. I created it and the command worked. Thanks!

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.