wget https://some.url/with/a/file.txt
Returns No such file or directory
despite file.txt
being present at the location (can be downloaded via browser).
Also the directory to save to is writeable by the user running the command.
wget https://some.url/with/a/file.txt
Returns No such file or directory
despite file.txt
being present at the location (can be downloaded via browser).
Also the directory to save to is writeable by the user running the command.
There are a lot of related threads but nothing helped.
Finally found out there is an illegal character in front of the url!
That was so hard to find I post it here in case anyone stumbles upon the same.
Close the terminal and try again to run the script.
Stumbled upon this with a similar issue using curl. The root cause for me was curl was unable to find the destination directory.
adding --create-dirs
to the command will ask curl to create the directories if they do not exist, which solved my issue.
eg.
# I want to download this file to ~/development/csvs/saved_file.csv
# Assume I am executing from a ~/development/ directory, which has no csv dir
# this will not work
curl 'https://bla.com/cool_csv.csv' > csvs/saved_file.csv
# this will work
curl 'https://bla.com/cool_csv.csv' -o csvs/saved_file.csv --create-dirs
-o
will replace >
and will specify output
© 2022 - 2024 — McMap. All rights reserved.