<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>lftp Archives - CNERIS</title>
	<atom:link href="https://cneris.com/en/tag/lftp-en/feed/" rel="self" type="application/rss+xml" />
	<link>https://cneris.com/en/tag/lftp-en/</link>
	<description></description>
	<lastBuildDate>Sun, 25 Aug 2024 20:32:02 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.1</generator>
	<item>
		<title>Manual for Using lftp in Linux</title>
		<link>https://cneris.com/en/manual-for-using-lftp-in-linux/</link>
					<comments>https://cneris.com/en/manual-for-using-lftp-in-linux/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sun, 25 Aug 2024 20:32:02 +0000</pubDate>
				<category><![CDATA[Centos]]></category>
		<category><![CDATA[Dedicated servers]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[automating tasks]]></category>
		<category><![CDATA[lftp]]></category>
		<category><![CDATA[script in lftp]]></category>
		<guid isPermaLink="false">https://cneris.com/?p=2158</guid>

					<description><![CDATA[<p>1. Introduction to lftp lftp is a command-line client for transferring files via FTP, FTPS, HTTP, HTTPS, and other protocols. It is very versatile and offers advanced features like resuming downloads, directory synchronization, and background operations. 2. Installing lftp To install lftp on a Debian/Ubuntu-based system, use the following command: sudo apt-get update sudo apt-get [...]</p>
<p>The post <a href="https://cneris.com/en/manual-for-using-lftp-in-linux/">Manual for Using lftp in Linux</a> appeared first on <a href="https://cneris.com/en">CNERIS</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><strong>1. Introduction to lftp</strong></p>
<p><code>lftp</code> is a command-line client for transferring files via FTP, FTPS, HTTP, HTTPS, and other protocols. It is very versatile and offers advanced features like resuming downloads, directory synchronization, and background operations.</p>
<p><strong>2. Installing lftp</strong></p>
<p>To install <code>lftp</code> on a Debian/Ubuntu-based system, use the following command:</p>
<div class="dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium">
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-bash">sudo apt-get update<br />
sudo apt-get install lftp<br />
</code></div>
</div>
<p>On Red Hat/CentOS-based systems, use:</p>
<div class="dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium">
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-bash">sudo yum install lftp<br />
</code></div>
</div>
<p><strong>3. Basic Usage of lftp</strong></p>
<p><strong>Connecting to an FTP server:</strong></p>
<div class="dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium">
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-bash">lftp ftp://user@server<br />
</code></div>
</div>
<p>After executing this command, <code>lftp</code> will prompt you for a password. Once authenticated, you can navigate the FTP server as if you were using a local file system.</p>
<p><strong>4. Basic Commands within lftp</strong></p>
<ul>
<li><strong>Listing files:</strong><br />
Use <code>ls</code> to list files in the current directory on the server.</p>
<div class="dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium">
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-bash"><span class="hljs-built_in">ls</span><br />
</code></div>
</div>
</li>
<li><strong>Changing directory:</strong><br />
Use <code>cd</code> to change directories.</p>
<div class="dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium">
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-bash"><span class="hljs-built_in">cd</span> /path/to/directory<br />
</code></div>
</div>
</li>
<li><strong>Downloading a file:</strong><br />
Use <code>get</code> to download a file from the server to your local system.</p>
<div class="dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium">
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-bash">get file.txt<br />
</code></div>
</div>
</li>
<li><strong>Uploading a file:</strong><br />
Use <code>put</code> to upload a file from your local system to the server.</p>
<div class="dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium">
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-bash">put file.txt<br />
</code></div>
</div>
</li>
</ul>
<p><strong>5. Advanced Usage of lftp</strong></p>
<p><strong>Synchronizing Directories:</strong></p>
<p><code>lftp</code> can synchronize local directories with those on the remote server using the <code>mirror</code> command.</p>
<ul>
<li><strong>Downloading an entire directory:</strong>
<div class="dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium">
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-bash">mirror /remote_directory /local_directory<br />
</code></div>
</div>
</li>
<li><strong>Uploading an entire directory:</strong>
<div class="dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium">
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-bash">mirror -R /local_directory /remote_directory<br />
</code></div>
</div>
</li>
</ul>
<p><strong>Resuming Interrupted Downloads and Uploads:</strong></p>
<p>If a transfer is interrupted, <code>lftp</code> can resume it using the <code>-c</code> option.</p>
<div class="dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium">
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-bash">get -c large_file.iso<br />
</code></div>
</div>
<p><strong>6. Working in the Background</strong></p>
<p>You can run tasks in the background in <code>lftp</code> using the <code>bg</code> command:</p>
<ul>
<li><strong>Starting a download in the background:</strong>
<div class="dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium">
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-bash">get large_file.iso &amp;<br />
</code></div>
</div>
<p>You can then check the status of the background task with <code>jobs</code> and bring it to the foreground with <code>fg</code>.</li>
</ul>
<p><strong>7. Automating Tasks with lftp Scripts</strong></p>
<p>You can automate tasks with <code>lftp</code> by creating scripts:</p>
<div class="dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium">
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-bash"><span class="hljs-meta">#!/bin/bash</span><br />
lftp -e <span class="hljs-string">"mirror -R /local/path /remote/path; bye"</span> -u user,password ftp://server<br />
</code></div>
</div>
<p>Save this script, give it execution permissions with <code>chmod +x script.sh</code>, and run it with <code>./script.sh</code>.</p>
<p><strong>8. Conclusion</strong></p>
<p><code>lftp</code> is a powerful tool for managing file transfers in Linux. With this manual, you can start using <code>lftp</code> for your basic and advanced file transfer needs.</p>
<p>The post <a href="https://cneris.com/en/manual-for-using-lftp-in-linux/">Manual for Using lftp in Linux</a> appeared first on <a href="https://cneris.com/en">CNERIS</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://cneris.com/en/manual-for-using-lftp-in-linux/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
