Accessing webdav shares from the command line


I have been using webdav as a centralized storage system for a the past year or so. I typically use the OS X built-in DAV support, but recently needed to be able to access my DAV share through the shell. After a bit of poking around on the web, I came across the cadaver command line DAV client. Cadaver is pretty slick, and operates very similar to an FTP client. You can use ls to view files, delete to delete files, and put to place files in a DAV share. To use cadaver, you can execute it with the share you want to access:

$ cadaver http://localhost:8080/dav

Once you are connected, you can feed one or more commands to the cadaver prompt:

dav:/dav/> ls 404 Not Found Listing collection `/dav/': collection is empty.

dav:/dav/> put orca-snapshot-r529.tar Uploading orca-snapshot-r529.tar to `/dav/orca-snapshot-r529.tar’: Progress: [=============================>] 100.0% of 262 bytes succeeded.

dav:/dav/> ls Listing collection `/dav/': succeeded. orca-snapshot-r529.tar 10045440 Jun 7 13:27

dav:/dav/> move orca-snapshot-r529.tar orca.tar Moving /dav/orca-snapshot-r529.tar' to /dav/orca.tar’: succeeded.

dav:/dav/> ls Listing collection `/dav/': succeeded. orca.tar 10045440 Jun 7 13:30

dav:/dav/> delete orca.tar Deleting `orca.tar’: succeeded.

Cadaver is a cool piece of software, and one that I will be using frequently!!

This article was posted by Matty on 2007-06-09 11:40:00 -0400 -0400