megatools-test(1)
π megatools-test β the vibe check for your Mega.nz files π
okay so bestie, welcome to megatools-test(1) from the megatools manual set π«Ά this little icon is literally just here to answer one question: does this thing exist or not β¨
πΈ NAME πΈ
megatools test β test for existence of files or folders. no cap, that's the whole job π
β¨ SYNOPSIS β¨
megatools test [-f|-d] <remotepaths>...
π¦ DESCRIPTION π¦
So basically this tool tests for existence of files or paths of files stored on Mega.nz. that's it, that's the assignment π
The exit codes are giving very structured, very main character:
- If all
<remotepaths>match the condition, the tool returns status code0β - If one of the
<remotepaths>doesn't exist, the tool returns1π - If one of the
<remotepaths>doesn't match the-for-dfilter, the tool returns2π - For other errors, the tool returns
3π
π OPTIONS π
--file,-fβ require all<remotepaths>to be files. every single one. periodt π--folder,-dβ require all<remotepaths>to be folders. all of them or nothing bestie π-u <email>,--username <email>β account username (email). it's giving login energy β¨-p <password>,--password <password>β account password. keep it secret, keep it safe π€«--no-ask-passwordβ never ask interactively for a password. it just will not do the asking thing π--reloadβ reload filesystem cache. refresh, bestie, refresh π--limit-speed <speed>β set maximum allowed upload and download speed inKiB/s. this option overrides config file settings.0means no limit. when usingParallelTransfers > 1, upload speed limit is applied to each transfer individually. okay so important detail: each transfer gets its own limit, iykyk π--proxy <proxy>β use proxy server to connect to mega.nz. this option overrides config file settings. more information can be found in 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 serversocks5h://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 IP address bound to some of your local network interfaces, when specifying an IP address. yes that's a real caveat, read it twice π--ip-proto <proto>β which IP protocol to prefer when connecting to mega.nz (v4,v6, orany). this is just an advisory option. Megatools will resolve mega.nz domain, and then use an A or AAAA record based on the stated preference. it's a suggestion, not a demand π--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 callsfs: dump Mega.nz filesystem (may require--reloadto actually print something)cache: dump cache contentstman: dump transfer manager events π₯
--versionβ show version information<remotepaths>β one or more remote filesystem paths to test.
π EXAMPLES π
- test for existence of a path:
$ megatools test /Root/README
$ test $? -eq 0 && echo "File or folder exists at /Root/README"
File or folder exists at /Root/README
- test for existence of multiple files:
$ megatools test -f /Root/file1 /Root/file2
$ test $? -eq 0 && echo "/Root/file1 and /Root/file2 are both files"
/Root/file1 and /Root/file2 are both files
see, both files, both exist, both slay β¨
π REMOTE FILESYSTEM π
Mega.nz filesystem is represented as a tree of nodes of various types. nodes are identified by a 8 character node handles (eg. 7Fdi3ZjC). structure of the filesystem is not encrypted. okay noted π«‘
Megatools maps node tree structure to a 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 dot and their node handle like this:
/Root/conflictingfile
/Root/conflictingfile.7Fdi3ZjC
/Root/conflictingfile.mEU23aSD
you need to be aware of several special folders:
/Rootβ writable directory representing the root of the filesystem./Trashβ trash directory where Mega.nz web client moves deleted files. this directory is not used by megatools when removing files./Inboxβ not sure. π (yes, the manual literally says "Not sure." iconic honestly)/Contactsβ directory containing subdirectories representing your contacts list. if you want to add contacts to the list, simply create 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.
π 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. yes, it's in the group chat π
π 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 upstream repository. so like, bring solutions not problems bestie π
β 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 babes π this was megatools-test(1), dated 11 July 2025, and it's part of the megatools manual set β go test some paths, you got this πΈπ¦π
π¦ where this page comes from
- debian trixie: megatools 1.11.5-1 Β· GPL-2+with_exception
- ubuntu questing: megatools 1.11.5-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms