Access Dropbox via CLI (terminal) in Linux !

Dropbox, one of the leading cloud storage provider on the planet has more then 400 million registered users and most of them are free and by default Dropbox provides free 2 Gb space. As of now for every referral the user gets free 500 Mb + the other users too gets this benefit, as of now there are other options too for getting the free space, like linking to the Mailbox and Carousel accounts etc, (note at the time of writing both the apps viz. Mailbox and Carousel are going to shutdown as announced in a blog post by Dropbox).

The popularity of Dropbox has led to a plethora number of official and unofficial Dropbox clients that are available for cross platform users. Here we are going to discuss a basic Dropbox uploader, and a BASH script to access via the CLI(Command Line Interface) in/via the Linux terminal.

First things first:-

Fire up the terminal and paste the below given commands.

$ wget https://raw.github.com/andreafabrizi/Dropbox-Uploader/master/dropbox_uploader.sh
$ chmod +x dropbox_uploader.sh

Make sure that curl is present/installed on your system, if not just type in Ubuntu/Debian,

sudo apt-get install curl

To access the Dropbox, just run the uploader script, for the first time it will ask you for the access of you Dropbox account.

But before you do that please visit www.developers.dropbox.com and create an app with full Dropbox access !

 

Post that run the script as shown below in your terminal,

$ ./dropbox_uploader.sh

Go to your terminal, you will see this,

Enter the App key and the App secret(note that app secret cannot be copied, it has to be manually typed).

Now go to the URL as mentioned above in the screenshot(pixalated one) and you will be up and running in no time.

 

This successfully completes the required Dropbox uploader requirements and just in order to confirm the authentication, copy paster below:-

$ ./dropbox_uploader.sh info

Dropbox uploader examples:-

To list all contents in the top-level directory:

$ ./dropbox_uploader.sh list

To list all contents in a specific folder:

$ ./dropbox_uploader.sh list Documents/manuals

To upload a local file to a remote Dropbox folder:

$ ./dropbox_uploader.sh upload snort.pdf Documents/manuals

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

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

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

$ ./dropbox_uploader.sh download Documents/manuals ./manuals

To create a new remote folder on Dropbox:

$ ./dropbox_uploader.sh mkdir Documents/whitepapers

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

$ ./dropbox_uploader.sh delete Documents/manuals

Thats it, Enjoy !

[via:- xmodulo and askubuntu].

Akash Angle

I am a Full time Linux user who has quit using Windows for unknown reasons, making my life truly open source.

Recent Posts

Get the most juice from your ISP/router — setting MTU size & other handy tweaks

This is not an ad-vocation by any means for TP-link branding, however a real life…

7 months ago

How to make any Android phone up-to 3x faster – Developer options unleashed

First of all we need to hit the kernel version on any Android device. You…

7 months ago

systemd-resolve command not found in Ubuntu Desktop

Use resolvectl status instead. It's like something deprecates and suddenly things get broken! In systemd…

12 months ago

How to exclude multiple directories with rsync?

Geeky question: This is what people and friends have tried: rsync -arv --exclude "/home/john/.ccache:/home/ben/build" /home/john…

12 months ago

How to resolve apt-get -f not working

You might encounter this error which appears to be very common on Debian based Distro's…

12 months ago

How to install Broadcom STA wireless drivers on Kali Linux

PS: This article is for only Kali Linux users, that too having a Broadcom Wireless…

1 year ago