megatools-ls(1)

πŸ’– megatools-ls β€” the "what's in my cloud bestie" page πŸ’–

okay so this is megatools-ls(1), part of the megatools crew, and it's literally the cutest way to peek at what's chillin' in your Mega.nz cloud. let's get into it πŸ’…


✨ NAME ✨

megatools ls β€” List files stored in the cloud πŸ¦‹


✨ SYNOPSIS ✨

megatools ls [-e] [-h] [--header] [-l] [-R] [-n] [<remotepaths>...]

✨ DESCRIPTION ✨

Lists files stored on Mega.nz, exports public download links. that's it, that's the whole vibe πŸŽ€


✨ OPTIONS ✨

  • --export, -e β€” for every file that's about to get listed, it also shows you the public download link with the file key. so you can share the good stuff 🫢
NOTE: folders export doesn't work yet. not me being honest about it. 😭
  • --human, -h β€” shows file sizes in a human readable format. because 2686 is giving nothing and 2.6 KiB is giving everything ✨
  • --header β€” for long list format, it displays a header describing all the listed columns. labels on the table, periodt πŸ‘‘
  • --long, -l β€” lists extra info about the listed filesystem nodes: node handle, owner, node type, file size, and the last modification date. the whole lore drop πŸ“–
  • --recursive, -R β€” lists directories recursively. this is the default when you don't specify any paths, lowkey just how it do 🌈
  • --names, -n β€” show only the names of nodes within the directory. this option only has effect if you specified a single path on the command line. one path only bestie, that's the rule πŸ’€
  • --print0, -0 β€” separates file names with NULs instead of new lines. for when your other tools want NULs, iykyk 🧚
  • -u <email>, --username <email> β€” account username (email) πŸ’Œ
  • -p <password>, --password <password> β€” account password πŸ”
  • --no-ask-password β€” never ask interactively for a password. it will NOT be popping up a prompt, no cap πŸ™ˆ
  • --reload β€” reload filesystem cache πŸ”„
  • --limit-speed <speed> β€” set maximum allowed upload and download speed in KiB/s. this option overrides config file settings. 0 means no limit. when using ParallelTransfers > 1, the upload speed limit is applied to each transfer individually. okay so it's per-transfer when parallel, noted ✍️
  • --proxy <proxy> β€” use a proxy server to connect to mega.nz. this option overrides config file settings. more info lives in the libcurl documentation at ⟨https://curl.haxx.se/libcurl/c/CURLOPT_PROXY.html⟩. some acceptable values are:
    • none : disable proxy if it was enabled in the config file.
    • socks5://localhost:9050 : local SOCKSv5 proxy server
    • socks5h://localhost:9050 : local SOCKSv5 proxy server with DNS handled by the proxy
  • --netif <ifname|ip> β€” network interface or local IP address used for outgoing connections. you have to specify an IP address bound to some of your local network interfaces when specifying an IP address. the way that it needs a bound IP specifically 😀
  • --ip-proto <proto> β€” which IP protocol to prefer when connecting to mega.nz (v4, v6, or any). this is just an advisory option. megatools will resolve the mega.nz domain, and then use an A or AAAA record based on the stated preference. advisory only, it's a suggestion bestie πŸ¦‹
  • --config <path> β€” load configuration from a file πŸ“„
  • --ignore-config-file β€” disable loading .megarc 🚫
  • --debug [<options>] β€” enable debugging of various aspects of the megatools operation. you may enable multiple debugging options separated by commas. (eg. --debug api,fs) πŸ”

Available options are:

  • http: dump HTTP request/response details (can be used to debug connection/proxy issues)
  • api: dump Mega.nz API calls
  • fs: dump Mega.nz filesystem (may require --reload to actually print something)
  • cache: dump cache contents
  • tman: dump transfer manager events
  • --version β€” show version information ⭐
  • <remotepaths> β€” one or more remote filesystem paths to list. if the path points to a directory, the contents of the directory and the directory itself are listed. when --names is given, only the contents of the directory are listed. πŸ‘€

If the path points to a file, the file itself is listed.

If omitted, the entire remote filesystem is listed recursively. the whole thing. everything. 🌍


✨ EXAMPLES ✨

  • List all files:
$ megatools ls

/Contacts
/Inbox
/Root
/Root/README
/Root/bigfile
/Trash
  • List all files in the /Root, recursively and with details:
$ megatools ls -l /Root

3RsS2QwJ                2             - 2013-01-22 12:31:06 /Root
2FFSiaKZ    Xz2tWWB5Dmo 0          2686 2013-04-15 08:33:47 /Root/README
udtDgR7I    Xz2tWWB5Dmo 0    4405067776 2013-04-10 19:16:02 /Root/bigfile
  • List all files in the /Root, recursively and with details, show only file names:
$ megatools ls -ln /Root

2FFSiaKZ    Xz2tWWB5Dmo 0          2686 2013-04-15 08:33:47 README
udtDgR7I    Xz2tWWB5Dmo 0    4405067776 2013-04-10 19:16:02 bigfile
  • Export download links:
$ megatools ls -e /Root/README

https://mega.nz/#!OFFRlbgR!k5rWmLp3mxB0gsq07Ii67PLd9L0wq4KondFLDlfH3Uw /Root/README
  • List files in a more human readable format:
$ megatools ls -hnl --header /Root/README

===================================================================================
Handle      Owner       T          Size Mod. Date           Filename
===================================================================================
2FFSiaKZ    Xz2tWWB5Dmo 0       2.6 KiB 2013-04-15 08:33:47 README

✨ REMOTE FILESYSTEM ✨

Mega.nz filesystem is represented as a tree of nodes of various types. nodes are identified by 8 character node handles (eg. 7Fdi3ZjC). the structure of the filesystem is not encrypted. πŸ‘€

Megatools maps that node tree structure to traditional filesystem paths (eg. /Root/SomeFile.DAT).

NOTE: by the nature of Mega.nz storage, several files in the directory can have the same name. to allow access to such files, the names of conflicting files are extended by appending a dot and their node handle, like this:
/Root/conflictingfile
/Root/conflictingfile.7Fdi3ZjC
/Root/conflictingfile.mEU23aSD

You need to be aware of several special folders, bestie, take notes πŸ“:

  • /Root β€” writable directory representing the root of the filesystem. πŸ‘‘
  • /Trash β€” trash directory where the Mega.nz web client moves deleted files. this directory is not used by megatools when removing files. so don't go looking for your deleted stuff there via megatools 😭
  • /Inbox β€” not sure. (yeah that's genuinely what the docs say, iconic honestly πŸ’€)
  • /Contacts β€” directory containing subdirectories representing your contacts list. if you want to add contacts to the list, simply create a subdirectory named after the contact you want to add. 🫢
  • /Contacts/<email> β€” directories representing individual contacts in your contacts list. these directories contain folders that others shared with you. all shared files are read-only, at the moment. so look, don't touch πŸ”’

✨ SEE ALSO ✨

megatools(1), megarc(5), megatools-df(1), megatools-dl(1), megatools-get(1), megatools-ls(1), megatools-mkdir(1), megatools-put(1), megatools-reg(1), megatools-rm(1), megatools-copy(1).

the whole friend group fr fr πŸŽ€


✨ MEGATOOLS ✨

Part of the megatools(1) suite of commands. 🌈


✨ BUGS ✨

There is no upstream support for bugreports and feature requests. but you can send code patches to megatools@xff.cz ⟨mailto:megatools@xff.cz⟩ to get them integrated into the upstream repository. so like… bring a patch, not a complaint πŸ’…


✨ AUTHOR ✨

Megatools was written by Ondrej Jirman < megatools@xff.cz ⟨mailto:megatools@xff.cz⟩ >, 2013-2022. πŸ‘‘

Official website is ⟨https://xff.cz/megatools/⟩. 🌸


and that's the whole page bestie β€” this is megatools-ls(1) from the megatools manual, dated 11 July 2025, mwah, go list some files πŸ’–βœ¨

πŸ“¦ where this page comes from