Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I get the public URL of a file via a command? I need to do this within a Lua script, so Python or whatever else API's are offered aren't any good.

share|improve this question
Edit: Nevermind, I see the ubuntu-one tag now. – Oli Apr 7 '11 at 15:29
up vote 4 down vote accepted

To get a public URL for a file via the commandline, you do

u1sdtool --publish-file=filename

if the file is already published, it will return the existing URL; otherwise, it will publish the file and return the newly created URL.

share|improve this answer
Thank you... can you help perfect it? I can't quite figure it out, trying it on an already published file (while U1 is disconnected though... still uploading my music collection): – Vadi Apr 9 '11 at 11:31
add a backslash before the space in "Ubuntu One", or put quotes around the whole path. – Chipaca Apr 10 '11 at 9:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.