megatools-export(1)
===================

NAME
----
megatools export - create or remove public links for remote files and folders


SYNOPSIS
--------
[verse]
'megatools export' <remotepaths>...
'megatools export' --remove <remotepaths>...


DESCRIPTION
-----------

Creates public links for files and folders stored in your mega.nz account
and prints them, one per line, in the order of `<remotepaths>`. A file or
folder that already has a link (also one created in the webclient or
another app) keeps it, and that link is printed.

Anyone with a link can download the file, or everything in the folder,
also files added to the folder later, until the link is removed.

Folder links work like "Share link" in the mega.nz webclient: the folder
gets a share key, which is stored in the account's key store (^!keys) so
that the webclient and other apps show the same link, and all the keys of
the files and folders in it (including previous versions of files) are
sent to the server encrypted with that share key. This needs an account
with a key store: accounts registered with megatools reg or the current
webclient have one, older accounts get it on their first login to the
webclient.

The links have the form `https://mega.nz/file/HANDLE#KEY` and
`https://mega.nz/folder/HANDLE#KEY`. The key part after `#` is what gives
access, browsers never send it to the server.

Only files and folders can be exported, not /Root, /Trash or /Shared.
Links can be listed with `megatools ls -e` and downloaded with
man:megatools-dl[1].


OPTIONS
-------

--remove::
	Remove the links of the given files and folders instead. The folder's
	share key stays in the account's key store, exporting the folder
	again gives a new link with the same key.

include::auth-options.txt[]
include::basic-options.txt[]

<remotepaths>::
	One or more remote files or folders.


EXIT STATUS
-----------

0 when all links were created (or removed), 1 when something failed. A path
that doesn't exist is reported, and the links of the others are still
printed.


EXAMPLES
--------

* Export a file:
+
------------
$ megatools export /Root/README
https://mega.nz/file/OFFRlbgR#k5rWmLp3mxB0gsq07Ii67PLd9L0wq4KondFLDlfH3Uw
------------

* Export a folder, and remove its link later:
+
------------
$ megatools export /Root/Photos
https://mega.nz/folder/HIlFDajT#HLiVvQQkSe1d0ogxZuaOJg
$ megatools export --remove /Root/Photos
------------


include::remote-paths.txt[]

include::footer.txt[]
