I just had to download a file from an ownCloud public directory  with authentication (a password was set) directly onto a server and came around to use the excellent tool cadaver again.
It is available in most distributions (I only checked Debian, Ubuntu and Arch), so you should be able to just install it using the package manager of your distribution, e.g. like so on Ubuntu:
# as root apt-get install cadaver
Once that is completed successfully you can connect to a server.
- Either by giving it the webdav URL directly as CLI argument like so:
cadaver https://<owncloud FQDN(/path)?>/remote.php/webdav
- Or just starting it, with
cadaverand then using the
opencommand in it’s own little REPL
This will then ask you for your username and password and once entered correctly you are connected to the server.
On it’s REPL you can use the
help command to see all available commands. And
help <command> to learn more about how to use a specific command.
get to download a file and
put for uploading .
But to get back to the public link use case:
You need to instead of the private WebDAV connect to the public WebDAV, which is a little different:
When starting the connection this will again ask you for username and password, which might seem a little confusing. But all you have to do is enter the public link token as the username. If the public link is password protected, enter the password as password, otherwise just keep it empty. Et voilà, you are done!
Remember, if it is a big file to download, you might want to start it in a screen session, so it is not a problem if you loose connection to the server and the download keeps running in the background.
 If the public link is just a file, it is not available via WebDAV, you will have to use curl directly to download it:
curl -u '<token>:<password>' https://<owncloud FQDN(/path)?>/public.php/webdav -o <filename.ext> (or the equivalent
 For public link file drops use Accessing ownCloud Files Using WebDAV :: ownCloud Documentation
 A public link usually looks like this:
https://<owncloud FQDN(/path)?>(/index.php)?/s/deisL96qgid5tYO. The token is the part at the end of the URL, in this case