{
    "content": [
        {
            "type": "text",
            "text": "# ftp (perldoc)\n\n## TLDR\n\n> Tools to interact with a server via File Transfer Protocol.\n\n- Connect to an FTP server and run in interactive mode:\n  `ftp {{ftp.example.com}}`\n- Connect to an FTP server specifying its IP address and port:\n  `ftp {{ip_address}} {{port}}`\n- [Interactive] Switch to binary transfer mode (graphics, compressed files, etc):\n  `binary`\n- [Interactive] Transfer multiple files without prompting for confirmation on every file:\n  `prompt off`\n- [Interactive] Download multiple files (glob expression):\n  `mget {{*.png}}`\n- [Interactive] Upload multiple files (glob expression):\n  `mput {{*.zip}}`\n- [Interactive] Delete multiple files on the remote server:\n  `mdelete {{*.txt}}`\n- [Interactive] Rename a file on the remote server:\n  `rename {{original_filename}} {{new_filename}}`\n\n*Source: tldr-pages*\n\n---\n\n## Section Outline\n\n- **Found in /usr/share/perl/5.34/pod/perlfaq8.pod** (23 lines)\n- **Found in /usr/share/perl/5.34/pod/perlfaq9.pod** (4 lines)\n\n## Full Content\n\n### Found in /usr/share/perl/5.34/pod/perlfaq8.pod\n\nCan I use perl to run a telnet or ftp session?\nTry the Net::FTP, TCP::Client, and Net::Telnet modules (available from\nCPAN). <http://www.cpan.org/scripts/netstuff/telnet.emul.shar> will also\nhelp for emulating the telnet protocol, but Net::Telnet is quite\nprobably easier to use.\n\nIf all you want to do is pretend to be telnet but don't need the initial\ntelnet handshaking, then the standard dual-process approach will\nsuffice:\n\nuse IO::Socket;             # new in 5.004\nmy $handle = IO::Socket::INET->new('www.perl.com:80')\nor die \"can't connect to port 80 on www.perl.com $!\";\n$handle->autoflush(1);\nif (fork()) {               # XXX: undef means failure\nselect($handle);\nprint while <STDIN>;    # everything from stdin to socket\n} else {\nprint while <$handle>;  # everything from socket to stdout\n}\nclose $handle;\nexit;\n\n### Found in /usr/share/perl/5.34/pod/perlfaq9.pod\n\nHow do I fetch/put an (S)FTP file?\nNet::FTP, and Net::SFTP allow you to interact with FTP and SFTP (Secure\nFTP) servers.\n\n"
        }
    ],
    "structuredContent": {
        "command": "ftp",
        "section": "-q",
        "mode": "perldoc",
        "summary": null,
        "synopsis": null,
        "tldr_summary": "Tools to interact with a server via File Transfer Protocol.",
        "tldr_examples": [
            {
                "description": "Connect to an FTP server and run in interactive mode",
                "command": "ftp {{ftp.example.com}}"
            },
            {
                "description": "Connect to an FTP server specifying its IP address and port",
                "command": "ftp {{ip_address}} {{port}}"
            },
            {
                "description": "[Interactive] Switch to binary transfer mode (graphics, compressed files, etc)",
                "command": "binary"
            },
            {
                "description": "[Interactive] Transfer multiple files without prompting for confirmation on every file",
                "command": "prompt off"
            },
            {
                "description": "[Interactive] Download multiple files (glob expression)",
                "command": "mget {{*.png}}"
            },
            {
                "description": "[Interactive] Upload multiple files (glob expression)",
                "command": "mput {{*.zip}}"
            },
            {
                "description": "[Interactive] Delete multiple files on the remote server",
                "command": "mdelete {{*.txt}}"
            },
            {
                "description": "[Interactive] Rename a file on the remote server",
                "command": "rename {{original_filename}} {{new_filename}}"
            }
        ],
        "tldr_source": "official",
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "Found in /usr/share/perl/5.34/pod/perlfaq8.pod",
                "lines": 23,
                "subsections": []
            },
            {
                "name": "Found in /usr/share/perl/5.34/pod/perlfaq9.pod",
                "lines": 4,
                "subsections": []
            }
        ]
    }
}