How to access Dropbox from the command line in Linux

Cloud storage is everywhere in today's multi-device environment, where people want to access content across multiple devices wherever they go. Dropbox is the most widely used cloud storage service thanks to its elegant UI and flawless multi-platform compatibility. The popularity of Dropbox has led to a flurry of official or unofficial Dropbox clients that are available across different operating system platforms.

Linux has its own share of Dropbox clients: CLI clients as well as GUI-based clients. Dropbox Uploader is an easy-to-use Dropbox CLI client written in BASH scripting language. In this tutorial, I describe how to access Dropbox from the command line in Linux by using Dropbox Uploader.

Install and Configure Dropbox Uploader on Linux

To use Dropbox Uploader, download the script and make it executable.

$ wget
$ chmod +x

Make sure that you have installed curl on your system, since Dropbox Uploader runs Dropbox APIs via curl.

To configure Dropbox Uploader, simply run When you run the script for the first time, it will ask you to grant the script access to your Dropbox account.

$ ./

As instructed above, go to on your web browser, and create a new Dropbox app. Fill in the information of the new app as shown below, and enter the app name as generated by Dropbox Uploader.

After you have created a new app, you will see app key/secret on the next page. Make a note of them.

Enter the app key and secret in the terminal window where is running. will then generate an oAUTH URL (e.g.,

Go to the oAUTH URL generated above on your web browser, and allow access to your Dropbox account.

This completes Dropbox Uploader configuration. To check whether Dropbox Uploader is successfully authenticated, run the following command.

$ ./ info
Dropbox Uploader v0.12

 > Getting info... 

Name:	Dan Nanni
Email:	my@email_address
Quota:	2048 Mb
Used:	13 Mb
Free:	2034 Mb

Dropbox Uploader Examples

To list all contents in the top-level directory:

$ ./ list

To list all contents in a specific folder:

$ ./ list Documents/manuals

To upload a local file to a remote Dropbox folder:

$ ./ upload snort.pdf Documents/manuals

To download a remote file from Dropbox to a local file:

$ ./ download Documents/manuals/mysql.pdf ./mysql.pdf

To download an entire remote folder from Dropbox to a local folder:

$ ./ download Documents/manuals ./manuals

To create a new remote folder on Dropbox:

$ ./ mkdir Documents/whitepapers

To delete an entire remote folder (including all its contents) on Dropbox:

$ ./ delete Documents/manuals

Subscribe to Xmodulo

Do you want to receive Linux FAQs, detailed tutorials and tips published at Xmodulo? Enter your email address below, and we will deliver our Linux posts straight to your email box, for free. Delivery powered by Google Feedburner.

Support Xmodulo

Did you find this tutorial helpful? Then please be generous and support Xmodulo!

The following two tabs change content below.
Dan Nanni is the founder and also a regular contributor of He is a Linux/FOSS enthusiast who loves to get his hands dirty with his Linux box. He likes to procrastinate when he is supposed to be busy and productive. When he is otherwise free, he likes to watch movies and shop for the coolest gadgets.

25 thoughts on “How to access Dropbox from the command line in Linux

  1. I have nothing against Dropbox but if we are serious about privacy, having your own mail and file storage servers in a place where the US authorities can't get to would be sound.

  2. I don't get it. If you're running the official DropBox client, you can open a terminal on the DropBox folder and use any file-related command (ls, rm, cp, grep, awk, find, etc...). No complex setup needed. What does this do that's not already available?

  3. @Perplexed: it may be because the dropbox client is proprietary software. Trusting the API is one thing, trusting closed source software on your machine is quite another.

  4. This is a great script, but under my company's RedHat printf's syntax seems not to work quite good :
    "encoded+=: command not found"
    or "printf: -v: invalid option"
    Do you have a clue ? I'm not that good at URL encoding in regexp-bash style...

  5. I want to use curl to talk to dropbox and found something about that on stackoverflow. Either way, it needs an oauth access token secret. How do I get that?

  6. Ok, I started all over. I created the app in dropbox, and followed all the instructions. Now I run the upload thing and upload it to "/"(plus filename).
    The reply I get is Failed: An error occurred requesting /upload

    The documentation isn't giving me any clues. Does anyone on here knows what I'm doing wrong?

    • I had the same problem, and I think it was because my token permissions didn't match what's on the dropbox account. Unlink and try again, but set permissions to "a" (App folder), not "f" (Full).

  7. That's excellent. Thank you for this great post.

    I have followed your tutorial and it work fine. However, for some reason, I was not able to upload some file types like ".tar". Any idea how to solve this.


    • Hi Fawaz

      At first I also wasn't able to upload .tar.gz files to Dropbox

      My .tar.gz file came uploaded as the foldername I wanted to upload to with no extension, instead of the right filename within the folder.

      What i did:
      1. Create a folder named Test on Dropbox (I gave full access to Dropbox)
      2. Again run the command: sudo ./ upload /mnt/something.tar.gz Test/
      3. Output from Uploading "/mnt/something.tar.gz" to "/Test/something.tar.gz"............

  8. I already had and existing dropbox app and was using it for backup of my database. I recently had to format my machine so I downloaded the script and made is executable. I ran the script and it asked for APP key and Secret Key which i supplied as the earlier App.

    So when I ran ./ info it gives me result, but when I ran ./ list it says listing failed. I cannot neither upload a file.

    Please help me. Thanks in advance.

  9. Just set this up to get screenshots and videos from my VM to Dropbox, so that I can work on a research paper. Thanks a ton Dan!

  10. For those asking "why"...

    I run a t1.micro on AWS. A dozen domains, and all the files are local. I get "ftp" and a pseudo versioning system by syncing my local sites folder to my server's folder.

    Yes, it could be done by FTP, but FTP doesn't back up files for 30 days.
    Yes, it could be done with GIT, but this is less work.

    For that purpose, I don't need privacy. It's all public webpages. It's a really good match for me.

  11. Hi,
    Thanks for the script. I tried, but it fails after i provide App Key, App Secret and Permission Type. It says

    Token request... grep: /tmp/du_resp_14271: No such file or directory
    sed: can't read /tmp/du_resp_14271: No such file or directory
    sed: can't read /tmp/du_resp_14271: No such file or directory

    Please, check your App key and secret...

    and quit.
    I am sure i am providing the right App key and secret. Please Help.

  12. I found this a really useful tool, but the chunked_upload didn't seem to work. I spent some time trying to figure out what was going on using -p and -d and looking at /tmp/du_resp_debug, and mainly it seems to be

    HTTP/1.1 413 Request Entity Too Large

    I tried using split to manually split files into 149MB chunks, which worked nicely. Although of course there's no way to unsplit on dropbox itself...

  13. This is a great tool!

    I expected to go through a whole list of scripts, having them all fail one after the other.
    This was the 1st one I tried, and it worked immediately.

    The documentation is superb - not too long, but precise and to the point - just what's needed.


  14. Great tool but this doesn't work for paths with unicode characters. Please fix this if you can, I beg you.

    I'm seeing this issue with Japanese characters in some file names, it says FAILED on such files.


  15. So far, everything works great! Very smooth tutorial. I prefer this over installing the Dropbox Desktop and running a daemon.

    But there is a typo, it should be ``, not ``. Had me confused for a second.

Leave a comment

Your email address will not be published. Required fields are marked *