Megatools

This article will show you how to install Megatools. Megatools is a set of command line tools for accessing Mega.co.nz cloud storage.

You'll need to execute some commands via SSH to use this software. There is a separate guide on how to connect to your slot via SSH. Commands are kept as simple as possible and in most cases will simply need to be copied and pasted into the terminal window (then executed by pressing the Enter key).

Installation

Install Megatools by logging in via SSH, then copying and pasting the following:

mkdir -p ~/bin
git clone https://github.com/megous/megatools.git ~/megatools
cd ~/megatools/
./autogen.sh --disable-docs --prefix=$HOME
make && make install
cd && rm -rf ~/megatools/

Installation notes

If your binary directory (~/bin) is not in PATH you'll need to give the full path when trying to run any of the megatools. A better alternative is to simply add ~/bin to PATH with the following commands:

echo "PATH=~/bin:$PATH" > ~/.bashrc
source ~/.bashrc

Using Megatools

Megatools features the following binaries:

megacopy
synchronize local and remote mega.nz directories
megadf
display mega.nz storage quotas/usage
megadl
download exported files from mega.nz
megaget
download individual files from mega.nz
megals
list files stored at mega.nz
megamkdir
create directories at mega.nz
megaput
upload files to mega.nz
megareg
register a new mega.nz account
megarm
remove files from mega.nz

You can get the usage guide by running the binary name with the --help-basic or --help-all options:

[server ~] megaget --help-all
Usage:
  megaget [OPTION…] - download individual files from mega.nz

Help Options:
  -h, --help                  Show help options
  --help-all                  Show all help options
  --help-basic                Show basic options
  --help-network              Show network options
  --help-auth                 Show authentication options

Basic Options:
  --config=PATH               Load configuration from a file
  --ignore-config-file        Disable loading .megarc
  --debug=OPTS                Enable debugging output
  --version                   Show version information

Network Options:
  --limit-speed=SPEED         Limit transfer speed (KiB/s)
  --proxy=PROXY               Proxy setup string

Authentication Options:
  -u, --username=USERNAME     Account username (email)
  -p, --password=PASSWORD     Account password
  --no-ask-password           Never ask interactively for a password
  --reload                    Reload filesystem cache

Application Options:
  --path=PATH                 Local directory or file name, to save data to
  --no-progress               Disable progress bar

Uninstallation

rm -rf ~/bin/{megacopy,megadf,megadl,megaget,megals,megamkdir,megaput,megareg,megarm}