### Downloading a Single File with megatools get Source: https://github.com/maxfork/megatools/blob/master/docs/megatools-get.txt Demonstrates a practical example of downloading a file from a Mega.nz account. It first lists the contents of the remote `/Root` directory and then downloads the `README` file to the current local directory, verifying its presence with `ls`. ```Shell $ megatools ls /Root /Root /Root/README $ megatools get /Root/README $ ls README ``` -------------------------------- ### Example Megarc Configuration File (INI) Source: https://github.com/maxfork/megatools/blob/master/docs/megarc.txt This example demonstrates a typical `megarc` configuration file, showing how to set login credentials, network speed limits, proxy settings, parallel transfers, and enable UI colors. It includes comments for clarity and illustrates the structure of the INI file. ```INI [Login] Username = your@email Password = yourpassword [Network] # 1MiB/s SpeedLimit = 1024 # Use over TOR Proxy = socks5://127.0.0.1:9050 ParallelTransfers = 2 [UI] Colors = true ``` -------------------------------- ### Basic Usage of megatools get Command Source: https://github.com/maxfork/megatools/blob/master/docs/megatools-get.txt Illustrates the general syntax for using the `megatools get` command. It shows how to specify remote paths and includes options for disabling progress reporting and directing downloads to a specific local path or streaming to stdout. ```Shell 'megatools get' [--no-progress] [--path ] ... ``` ```Shell 'megatools get' --path - ``` -------------------------------- ### Example: Exporting a file with megatools export (Shell) Source: https://github.com/maxfork/megatools/blob/master/docs/megatools-export.txt Provides a practical example of using `megatools export` to generate a public link for a file named `/Root/README`, showing both the command execution and the resulting Mega.nz public URL. ```Shell $ megatools export /Root/README https://mega.nz/#!OFFRlbgR!k5rWmLp3mxB0gsq07Ii67PLd9L0wq4KondFLDlfH3Uw ``` -------------------------------- ### Uploading a Local Directory to Mega.nz using Megatools Copy Source: https://github.com/maxfork/megatools/blob/master/docs/megatools-copy.txt This example demonstrates how to upload a local directory named 'MyBackups' to the '/Root/Backups' directory on Mega.nz using the `megatools copy` command. This is the default behavior when the `--download` option is not specified. ```Shell megatools copy --local MyBackups --remote /Root/Backups ``` -------------------------------- ### Downloading a Remote Directory from Mega.nz using Megatools Copy Source: https://github.com/maxfork/megatools/blob/master/docs/megatools-copy.txt This example shows how to download the remote directory '/Root/Backups' from Mega.nz to a local directory named 'MyBackups' using the `megatools copy` command. The `--download` option is crucial for specifying the download operation. ```Shell megatools copy --local MyBackups --remote /Root/Backups --download ``` -------------------------------- ### Uploading a file to the root directory using megatools put Source: https://github.com/maxfork/megatools/blob/master/docs/megatools-put.txt This example demonstrates how to upload a local file named 'README' to the root directory of your Mega.nz account using the `megatools put` command. It then uses `megatools ls` to verify the file's presence in the `/Root` directory. ```Bash $ megatools put README $ megatools ls /Root ``` -------------------------------- ### Exporting Public Download Links with megatools ls (Bash) Source: https://github.com/maxfork/megatools/blob/master/docs/megatools-ls.txt This example illustrates how to generate a public download link for a specific file (`/Root/README`) using the `-e` (export) option. The output includes the direct Mega.nz URL and the corresponding file path, allowing for easy sharing of files. ```bash https://mega.nz/#!OFFRlbgR!k5rWmLp3mxB0gsq07Ii67PLd9L0wq4KondFLDlfH3Uw /Root/README ``` -------------------------------- ### Displaying Version Information - Megatools - Shell Source: https://github.com/maxfork/megatools/blob/master/docs/basic-options.txt Shows the current version information of the megatools utility. This is useful for verifying the installed version or for debugging compatibility issues. ```Shell --version ``` -------------------------------- ### Checking Free Space Programmatically with Megatools df Source: https://github.com/maxfork/megatools/blob/master/docs/megatools-df.txt This example shows how to programmatically check the available free space using 'megatools df --free --gb'. It uses a shell 'test' command to determine if the free space is less than 1 GiB, which is useful for scripting alerts or conditional actions based on storage availability. ```Shell $ test `megatools df --free --gb` -lt 1 && \ echo "You have less than 1 GiB of available free space" ``` -------------------------------- ### Listing Files Recursively with Details in megatools ls (Bash) Source: https://github.com/maxfork/megatools/blob/master/docs/megatools-ls.txt This example shows how to list files and directories within the `/Root` path recursively, including detailed information such as node handle, owner, type, size, and modification date. It utilizes the `-l` (long list) option to provide comprehensive metadata for each entry. ```bash $ 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 ``` -------------------------------- ### Uploading a file with a different remote name using megatools put Source: https://github.com/maxfork/megatools/blob/master/docs/megatools-put.txt This example shows how to upload a local file named 'README' to your Mega.nz account, but save it with a different name, 'README.TXT', in the `/Root` directory. The `--path` option is used to specify the new remote name. `megatools ls` is then used to confirm the new file name. ```Bash $ megatools put --path /Root/README.TXT README $ megatools ls /Root ``` -------------------------------- ### Removing a Contact with megatools rm (Shell) Source: https://github.com/maxfork/megatools/blob/master/docs/megatools-rm.txt This example illustrates how to remove a contact from your Mega.nz contacts list using the `megatools rm` command. By specifying a path under `/Contacts` followed by the contact's email address, the command removes that contact. ```Shell $ megatools rm /Contacts/some@email.com ``` -------------------------------- ### Removing a Folder with megatools rm (Shell) Source: https://github.com/maxfork/megatools/blob/master/docs/megatools-rm.txt This example demonstrates how to remove a folder named `/Root/MyNewFolder` from your Mega.nz account using the `megatools rm` command. It first lists the directory contents, then removes the specified folder, and finally lists the directory again to show the folder has been removed. ```Shell $ megatools ls /Root /Root /Root/MyNewFolder $ megatools rm /Root/MyNewFolder $ megatools ls /Root /Root ``` -------------------------------- ### Loading Configuration - Megatools - Shell Source: https://github.com/maxfork/megatools/blob/master/docs/basic-options.txt Loads configuration settings for megatools from a specified file path. This allows users to use custom configurations instead of default or environment-based settings. ```Shell --config ``` -------------------------------- ### Creating a New Folder with megatools mkdir (Shell) Source: https://github.com/maxfork/megatools/blob/master/docs/megatools-mkdir.txt Demonstrates how to create a new folder named 'MyNewFolder' under the '/Root' directory on Mega.nz using `megatools mkdir`, followed by listing the contents of '/Root' to verify the creation. ```Shell $ megatools mkdir /Root/MyNewFolder $ megatools ls /Root /Root /Root/MyNewFolder ``` -------------------------------- ### Registering a New Mega.nz Account (Shell) Source: https://github.com/maxfork/megatools/blob/master/docs/megatools.txt This command registers a new Mega.nz account. The `--scripted` option is for automated use. You must provide an `--email`, a `--name` (real name), and a `--password` for the new account. ```Shell megatools reg [--scripted] --register --email --name --password ``` -------------------------------- ### Registering a New Mega.nz Account (Step 1) - Shell Source: https://github.com/maxfork/megatools/blob/master/docs/megatools-reg.txt This command initiates the first step of Mega.nz account registration. It creates a non-verified account using the provided email, name, and password. Upon successful execution, it outputs a command for the second verification step, which requires a state string and a link from the registration email. ```Shell $ megatools reg --register --email your@email.com --name "Your Name" --password "Your Password" ``` -------------------------------- ### Syntax for megatools export (Shell) Source: https://github.com/maxfork/megatools/blob/master/docs/megatools-export.txt Illustrates the command-line syntax for `megatools export`, specifying that it requires one or more remote file paths as input to create public links. ```Shell megatools export ... ``` -------------------------------- ### Streaming Public Mega.nz Link Content to Standard Output (Shell) Source: https://github.com/maxfork/megatools/blob/master/docs/megatools.txt This command downloads content from a single public Mega.nz file link and streams it directly to standard output (`--path -`), enabling immediate processing or previewing. ```Shell megatools dl --path - ``` -------------------------------- ### Listing Remote Mega.nz Files (Shell) Source: https://github.com/maxfork/megatools/blob/master/docs/megatools.txt This command lists files and directories on your Mega.nz cloud storage. Options include showing export links (`-e`), human-readable sizes (`-h`), displaying a header (`--header`), long listing format (`-l`), recursive listing (`-R`), and numeric IDs (`-n`). You can specify remote paths to list specific directories. ```Shell megatools ls [-e] [-h] [--header] [-l] [-R] [-n] [...] ``` -------------------------------- ### Copying Remote Files/Directories from Mega.nz (Shell) Source: https://github.com/maxfork/megatools/blob/master/docs/megatools.txt This command downloads a remote file or directory tree from Mega.nz to a specified local path. The `--download` flag explicitly indicates a download operation. Options `-n` and `--no-progress` function as described for uploads. ```Shell megatools copy [-n] [--no-progress] --download --local --remote ``` -------------------------------- ### Using Megatools with Configuration File (Shell) Source: https://github.com/maxfork/megatools/blob/master/docs/megarc.txt This command demonstrates how to use `megatools df` without explicitly providing username and password, relying on credentials stored in the `megarc` configuration file. This simplifies command-line usage by leveraging pre-configured settings. ```Shell $ megatools df ``` -------------------------------- ### Downloading from Public Mega.nz Links (Shell) Source: https://github.com/maxfork/megatools/blob/master/docs/megatools.txt This command downloads files directly from public Mega.nz links without requiring a login. The `--no-progress` option disables the progress bar, and `--path` specifies the local directory for saving. ```Shell megatools dl [--no-progress] [--path ] ... ``` -------------------------------- ### Displaying Human-Readable Space Usage with Megatools df Source: https://github.com/maxfork/megatools/blob/master/docs/megatools-df.txt This command demonstrates how to use 'megatools df -h' to display the total, used, and free space in the cloud in a human-readable format (e.g., GiB). It provides a quick overview of storage utilization for easy understanding. ```Shell $ megatools df -h Total: 50.0 GiB Used: 6.4 GiB Free: 43.6 GiB ``` -------------------------------- ### Listing All Files with megatools ls (Bash) Source: https://github.com/maxfork/megatools/blob/master/docs/megatools-ls.txt This snippet demonstrates how to list all files and directories in your Mega.nz cloud storage using the `megatools ls` command without any specific paths or options. It shows the default recursive listing behavior, providing a full overview of the remote filesystem. ```bash $ megatools ls /Contacts /Inbox /Root /Root/README /Root/bigfile /Trash ``` -------------------------------- ### Uploading Files to Mega.nz (Shell) Source: https://github.com/maxfork/megatools/blob/master/docs/megatools.txt This command uploads one or more local files to your Mega.nz cloud storage. The `--no-progress` option disables the progress bar, and `--path` specifies the remote directory where files should be uploaded. ```Shell megatools put [--no-progress] [--path ] ... ``` -------------------------------- ### Creating Remote Mega.nz Directories (Shell) Source: https://github.com/maxfork/megatools/blob/master/docs/megatools.txt This command creates one or more new directories on your Mega.nz cloud storage at the specified remote paths. ```Shell megatools mkdir ... ``` -------------------------------- ### Displaying Mega.nz Disk Usage (Shell) Source: https://github.com/maxfork/megatools/blob/master/docs/megatools.txt This command displays information about your Mega.nz cloud storage space usage. Options allow showing free, total, or used space, and specifying units like megabytes (`--mb`), gigabytes (`--gb`), or human-readable format (`-h`). ```Shell megatools df [--free|--total|--used] [--mb|--gb|-h] ``` -------------------------------- ### Creating Public Mega.nz Links (Shell) Source: https://github.com/maxfork/megatools/blob/master/docs/megatools.txt This command generates public export links for one or more specified remote files or folders on Mega.nz, allowing them to be shared without requiring a login. ```Shell megatools export ... ``` -------------------------------- ### Synchronizing Directories with Megatools Copy (Download Synopsis) Source: https://github.com/maxfork/megatools/blob/master/docs/megatools-copy.txt This synopsis illustrates the usage of `megatools copy` for downloading remote directories from Mega.nz to a local path. The `--download` option explicitly sets the operation direction to download, along with options for dry run (`-n`) and disabling progress reporting (`--no-progress`). ```Shell megatools copy [-n] [--no-progress] --download --local --remote ``` -------------------------------- ### Streaming Remote Mega.nz Files to Standard Output (Shell) Source: https://github.com/maxfork/megatools/blob/master/docs/megatools.txt This command downloads a single remote file from Mega.nz and streams its content directly to standard output (`--path -`), useful for piping to other commands or previewing without saving to disk. ```Shell megatools get --path - ``` -------------------------------- ### Verifying a Mega.nz Account Registration (Shell) Source: https://github.com/maxfork/megatools/blob/master/docs/megatools.txt This command verifies a pending Mega.nz account registration. The `--scripted` option is for automated use. You need to provide the `--state` and the verification `--link` obtained during the registration process. ```Shell megatools reg [--scripted] --verify ``` -------------------------------- ### Downloading Files from Mega.nz (Shell) Source: https://github.com/maxfork/megatools/blob/master/docs/megatools.txt This command downloads one or more remote files from Mega.nz to your local machine. The `--no-progress` option disables the progress bar, and `--path` specifies the local directory where files should be saved. ```Shell megatools get [--no-progress] [--path ] ... ``` -------------------------------- ### Synchronizing Directories with Megatools Copy (Upload Synopsis) Source: https://github.com/maxfork/megatools/blob/master/docs/megatools-copy.txt This synopsis shows the basic usage of `megatools copy` for uploading local directories to a remote Mega.nz path. It includes options for dry run (`-n`) and disabling progress reporting (`--no-progress`). The default direction is upload. ```Shell megatools copy [-n] [--no-progress] --local --remote ``` -------------------------------- ### Using Megatools with Explicit Credentials (Shell) Source: https://github.com/maxfork/megatools/blob/master/docs/megarc.txt This command shows the alternative way to use `megatools df` by providing the username and password directly as command-line arguments. This method is useful when a configuration file is not present, or when `--ignore-config-file` is used to bypass it. ```Shell $ megatools df --username my@email.com --password mypass ``` -------------------------------- ### Copying Local Files/Directories to Mega.nz (Shell) Source: https://github.com/maxfork/megatools/blob/master/docs/megatools.txt This command copies a local file or directory tree to a specified remote path on Mega.nz. The `-n` option prevents overwriting existing files, and `--no-progress` disables the progress bar. `--local` specifies the source path, and `--remote` specifies the destination. ```Shell megatools copy [-n] [--no-progress] --local --remote ``` -------------------------------- ### Verifying a Mega.nz Account (Step 2) - Shell Source: https://github.com/maxfork/megatools/blob/master/docs/megatools-reg.txt This command completes the second step of Mega.nz account registration. It verifies a previously created non-verified account using the state string obtained from the --register command and the verification link received via email. Successful execution confirms the account registration. ```Shell $ megatools reg --verify vbFFFv7AFM25etzkFXLs9A==:Z7FFbgAAAAAAAAAArL33eA==:inEONh3tmwY \\ 'https://mega.nz/#confirmciyfWXRGFNcM...' ``` -------------------------------- ### Listing File Names with Details in megatools ls (Bash) Source: https://github.com/maxfork/megatools/blob/master/docs/megatools-ls.txt This snippet demonstrates listing files in `/Root` recursively with details, but only showing the file names (not full paths) by combining the `-l` (long list) and `-n` (names only) options. This is particularly useful when you need to parse the output for file names while retaining essential metadata. ```bash $ 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 ``` -------------------------------- ### Enabling Debugging - Megatools - Shell Source: https://github.com/maxfork/megatools/blob/master/docs/basic-options.txt Enables debugging for various aspects of megatools operation. Multiple options can be specified, separated by commas (e.g., --debug api,fs), including http (HTTP request/response details), api (Mega.nz API calls), fs (Mega.nz filesystem), cache (cache contents), and tman (transfer manager events). ```Shell --debug [] ``` -------------------------------- ### Testing Existence of Multiple Files with MegaTools (Shell) Source: https://github.com/maxfork/megatools/blob/master/docs/megatools-test.txt This snippet illustrates how to verify the existence of multiple paths as files using 'megatools test' with the '-f' (file) option. It checks if both '/Root/file1' and '/Root/file2' exist and are files. The shell 'test' command then confirms the success of the operation based on the exit status. ```Shell $ megatools test -f /Root/file1 /Root/file2 $ test $? -eq 0 && echo "/Root/file1 and /Root/file2 are both files" ``` -------------------------------- ### Testing Remote File/Folder Existence (Shell) Source: https://github.com/maxfork/megatools/blob/master/docs/megatools.txt This command tests for the existence of specified files or folders on Mega.nz. Use `-f` to test for files or `-d` to test for directories, followed by one or more remote paths. ```Shell megatools test [-f|-d] ... ``` -------------------------------- ### Creating Contact-Specific Mega.nz Directories (Shell) Source: https://github.com/maxfork/megatools/blob/master/docs/megatools.txt This specific usage of `megatools mkdir` creates a directory within the 'Contacts' folder, typically used for organizing files associated with a particular contact email. ```Shell megatools mkdir /Contacts/ ``` -------------------------------- ### Adding a New Contact with megatools mkdir (Shell) Source: https://github.com/maxfork/megatools/blob/master/docs/megatools-mkdir.txt Illustrates the special case usage of `megatools mkdir` to add a new contact to your Mega.nz contacts list by specifying the contact's email address under the '/Contacts' path. ```Shell $ megatools mkdir /Contacts/some@email.com ``` -------------------------------- ### Specifying Password for Megatools (Shell) Source: https://github.com/maxfork/megatools/blob/master/docs/auth-options.txt This snippet illustrates how to supply the account password using either the short form '-p' or the long form '--password' command-line option for megatools. This is used in conjunction with the username for authentication. ```Shell -p ``` ```Shell --password ``` -------------------------------- ### Specifying Username for Megatools (Shell) Source: https://github.com/maxfork/megatools/blob/master/docs/auth-options.txt This snippet shows how to provide the account username (email) using either the short form '-u' or the long form '--username' command-line option for megatools. This is essential for authentication with the Mega service. ```Shell -u ``` ```Shell --username ``` -------------------------------- ### Downloading an exported file using megatools dl (Shell) Source: https://github.com/maxfork/megatools/blob/master/docs/megatools-dl.txt This command downloads a single exported file from Mega.nz using its public link. The file will be saved to the current working directory by default. ```Shell $ megatools dl 'https://mega.nz/#!7YVWhCzZ!bauBlAkKKvv8hIm-8-qFmGOYS289ToQWN7rGFPzXB_w' ``` -------------------------------- ### Downloading an exported folder using megatools dl (Shell) Source: https://github.com/maxfork/megatools/blob/master/docs/megatools-dl.txt This command downloads an entire exported folder from Mega.nz using its public link. The contents of the folder will be placed into a new directory within the current working directory, named after the folder. ```Shell $ megatools dl 'https://mega.nz/#F!HIlFDajT!HLiVvQQkSe1d0ogxZuaOJg' ``` -------------------------------- ### Listing Files with Human-Readable Sizes and Header in megatools ls (Bash) Source: https://github.com/maxfork/megatools/blob/master/docs/megatools-ls.txt This snippet shows how to list a file with human-readable sizes (`-h`), long format details (`-l`), and an explicit header (`--header`) for better readability. It combines multiple options to provide a comprehensive and user-friendly output, making file sizes easier to interpret. ```bash $ 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 ``` -------------------------------- ### Testing Existence of a Single Path with MegaTools (Shell) Source: https://github.com/maxfork/megatools/blob/master/docs/megatools-test.txt This snippet demonstrates how to use the 'megatools test' command to check if a specific path exists on Mega.nz. It then uses a shell 'test' command to check the exit status ('$?') of 'megatools test', printing a confirmation message if the path exists (status code 0). ```Shell $ megatools test /Root/README $ test $? -eq 0 && echo "File or folder exists at /Root/README" ``` -------------------------------- ### Reloading Filesystem Cache for Megatools (Shell) Source: https://github.com/maxfork/megatools/blob/master/docs/auth-options.txt This snippet shows the '--reload' option, used to force megatools to reload its internal filesystem cache. This can be necessary to reflect changes made outside of the current megatools session. ```Shell --reload ``` -------------------------------- ### Disabling Default Configuration - Megatools - Shell Source: https://github.com/maxfork/megatools/blob/master/docs/basic-options.txt Prevents megatools from loading the default .megarc configuration file. This is useful for ensuring a clean slate or when specific configurations are provided via other means. ```Shell --ignore-config-file ``` -------------------------------- ### Removing Remote Mega.nz Files/Directories (Shell) Source: https://github.com/maxfork/megatools/blob/master/docs/megatools.txt This command removes one or more specified files or directories from your Mega.nz cloud storage. ```Shell megatools rm ... ``` -------------------------------- ### Disabling Interactive Password Prompt for Megatools (Shell) Source: https://github.com/maxfork/megatools/blob/master/docs/auth-options.txt This snippet demonstrates the '--no-ask-password' option, which prevents megatools from interactively prompting the user for a password. This is useful for scripting or automated environments where interactive input is not possible. ```Shell --no-ask-password ``` -------------------------------- ### Removing Contact-Specific Mega.nz Directories (Shell) Source: https://github.com/maxfork/megatools/blob/master/docs/megatools.txt This specific usage of `megatools rm` removes a directory associated with a particular contact email within the 'Contacts' folder on Mega.nz. ```Shell megatools rm /Contacts/ ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.