I used wget
within bash to download a bunch of files from a parameterized URL. My URL file looked something like this:
http://www.example.com/Home/Sales?lrsn=48726
http://www.example.com/Home/Sales?lrsn=48727
http://www.example.com/Home/Sales?lrsn=48728
...and so on
I ran this wget command to fetch all the files into my directory:
wget -i urlfile.txt
The resulting set of files-- when I do an ls
in my directory-- has names like this:
'Sales?lrsn=48726'
'Sales?lrsn=48727'
'Sales?lrsn=48728'
My problem is that I cannot figure out how to use wildcards with those files. E.g., if I type ls 'Sales*8'
, I would expect it to list 'Sales?lrsn=48728'
(and any other matches). Instead, I get "No such file or directory".
Questions:
- What do I need to do to use wildcards with the files that my
wget
operation created? Simple example would be how to match usingls
. - How would one even create such files to reproduce this. I.e., I tried
touch 'text.txt'
andtouch "'test.txt'"
and other variations, but I can't seem to make a file that lists as'test.txt'
(starting and ending single-quotes). - Is there a simple way to provide a naming convention for downloads using the
wget -i
input mode? (I'm pretty sure the answer to this is "No," but... figured I'd ask.)
'
are being shown in thels
results because of the?
and=
signs that appear in the filenames. So I actually can do the wildcards if I do something likels Sales\?lrsn\=48*
. So I might have answered my own question after spending that time writing it up. – Marc May 12 '21 at 04:06