megadl
Download files from Mega.nz
TLDR
View documentation for the original command
SYNOPSIS
megadl [OPTIONS] { (-l | --link
PARAMETERS
-h, --help
Displays a help message and exits.
-v, --version
Shows the program version information and exits.
-q, --quiet
Suppresses all non-essential output, showing only critical errors or progress bars.
-u
Specifies the MEGA account email for authentication to access private files.
-p
Provides the MEGA account password for authentication. Use with caution or consider a configuration file.
-l
Specifies a public MEGA file link (e.g., https://mega.nz/file/ABCD#1234) for direct download.
-f
Specifies a public MEGA folder link for recursive download of its contents.
-o
Defines the local file or directory where the downloaded content will be saved.
--path
Used with -u and -p to specify the path to a file or folder within your authenticated MEGA cloud storage.
--disable-resume
Prevents the tool from attempting to resume interrupted downloads, starting fresh instead.
--ignore-init-errors
Instructs megadl to continue operations even if some initial errors are encountered.
--proxy
Configures megadl to use a specified HTTP or SOCKS proxy for all network connections.
--config
Specifies an alternative configuration file to load credentials or settings from, instead of the default.
DESCRIPTION
megadl is a powerful command-line utility, integral to the megatools suite, designed for downloading files and entire directories from the MEGA.nz cloud storage service.
It offers versatile methods for accessing content, including downloading public files or folders via their respective MEGA links, or by authenticating with a user's MEGA account credentials to retrieve private content. This tool is invaluable for automating downloads, integrating MEGA.nz operations into scripts, or for users who prefer a robust terminal interface over a graphical one. Key features include support for resuming interrupted downloads, specifying custom output paths, and handling various authentication scenarios. megadl provides a reliable and efficient way to manage MEGA downloads programmatically in a Linux environment.
CAVEATS
As megadl is part of the megatools suite, it relies on their ongoing compatibility with the evolving MEGA.nz API. Updates to MEGA's service may occasionally cause temporary disruptions or require updates to megatools. Providing passwords directly via command-line options (-p) can be insecure as they may be visible in process listings or shell history; using a configuration file (e.g., ~/.megarc) or environmental variables for credentials is generally more secure for automated tasks. Downloads of very large files or numerous items may consume significant local disk space and bandwidth.
INSTALLATION
megadl is not a built-in Linux command. It needs to be installed as part of the megatools package. On Debian/Ubuntu-based systems, you can install it using apt:
sudo apt install megatools
On Fedora/RHEL-based systems:
sudo dnf install megatools
For Arch Linux:
sudo pacman -S megatools
Source compilation is also an option for other distributions.
CONFIGURATION FILE
For persistent authentication or to avoid typing credentials repeatedly, megadl can utilize a configuration file, typically located at ~/.megarc. A sample .megarc might look like:
[Login]
Username = your_email@example.com
Password = your_mega_password
Ensure appropriate file permissions (e.g., chmod 600 ~/.megarc) to protect your credentials.
EXAMPLES
Download a public file link:
megadl --link 'https://mega.nz/file/ABCDEF#123456'
Download a public folder link:
megadl --folder 'https://mega.nz/folder/GHIJKL#789012'
Download a file from your private cloud storage:
megadl --user 'your_email@example.com' --password 'your_password' --path '/My Private Files/document.pdf'
Download to a specific output directory:
megadl --link 'https://mega.nz/file/ABCDEF#123456' --output './Downloads/my_file.zip'
HISTORY
The megadl command is a component of the megatools project, initiated by Martin PoviĊĦer (megous) as an open-source suite of command-line tools for MEGA.nz. Development began shortly after MEGA's relaunch in 2013, aiming to provide a programmatic interface to MEGA's encrypted cloud storage service, which lacked official Linux client support at the time. Its continuous development has focused on maintaining compatibility with MEGA's evolving API and expanding functionality, making it a staple for Linux users requiring terminal-based MEGA interactions.