Your provided URL downloads fine using for example:
curl -O "URL"
As mentioned in comments: quote. Always quote!
& has a special meaning in shells and the URL is not going to be interpreted as you want without them.
As for downloading without knowing the file name – I'm still not quite sure what you mean, but some notes:
This is site specific for ebi.ac.uk
The URL provided is a special form of URI. You are most likely interested in the query part, and more specifically the first section:
You can change this to represent other files and ranges. for example to download
curl -O "http://www.ebi.ac.uk/ena/data/view/U00000-U00096&display=fasta&download=fasta&filename=U00000-U00096.fasta"
^^^^ data ^^^
The file name part is simply a suggestion on what to name the file. You can change this to anything you want. For example:
filename=myown.fasta – is not going to change what is downloaded only what name is proposed by the server -> web-browser, and can also be used by curl etc.
There are a lot of search and listing possibilities on the site and you have to poke around.
More on what is happening
As you click the download link, or use tools like curl or wget a request is sent to the server at ebi.ac.uk for a specific file. In your example it likely has a referer set to:
and a GET query reported as:
query['display'] = fasta
query['download'] = fasta
query['filename'] = entry.fasta
The sever responds with something, among others, like:
Content-Disposition: attachment; filename=entry.fasta
This is a way for the server to rely a suggestion for file name back to the client. If you use a curl version that has the
-J option you can use this to save the file by this name: I.e.:
curl -OJ "URL"
This is quite site specific and the way the URL is interpreted on the server has to do with how the site is set up.
On a different host using another setup with a query part as
filename=foo.txt could just as well be that you are served the an actual file named
foo.txt from the server.
As for this site, ebi.ac.uk, the file is not a file but dynamically generated content using queries to databases. The result of the query is merged into a file and served to the end user.