<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: M. AGUNG RAMADHAN</title>
    <description>The latest articles on DEV Community by M. AGUNG RAMADHAN (@agung1010).</description>
    <link>https://dev.to/agung1010</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F928531%2F9f9ab6d1-e0a2-4d09-9459-d39f3e067171.png</url>
      <title>DEV Community: M. AGUNG RAMADHAN</title>
      <link>https://dev.to/agung1010</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/agung1010"/>
    <language>en</language>
    <item>
      <title>Hmm</title>
      <dc:creator>M. AGUNG RAMADHAN</dc:creator>
      <pubDate>Tue, 22 Nov 2022 11:30:52 +0000</pubDate>
      <link>https://dev.to/agung1010/hmm-5gpo</link>
      <guid>https://dev.to/agung1010/hmm-5gpo</guid>
      <description>&lt;p&gt;...&lt;/p&gt;

</description>
    </item>
    <item>
      <title>ARCHIVING AND TRANSFERRING FILES</title>
      <dc:creator>M. AGUNG RAMADHAN</dc:creator>
      <pubDate>Sun, 25 Sep 2022 02:28:26 +0000</pubDate>
      <link>https://dev.to/agung1010/archiving-and-transferring-files-17h</link>
      <guid>https://dev.to/agung1010/archiving-and-transferring-files-17h</guid>
      <description>&lt;p&gt;&lt;strong&gt;&lt;u&gt;ARCHIVING&lt;/u&gt;&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. The Tar Command&lt;/strong&gt;&lt;br&gt;
   File archiving and compression are used when backing up and transferring data over certain networks. One command that is often used is to use the "tar" command. With the tar command, users can collect large files into one file or called an archive. The archive can be compressed using gzip, bzip2, or xz compression.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Tar Options&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;-c, --create&lt;/code&gt;  -&amp;gt; to creates a new archive.&lt;br&gt;
&lt;code&gt;-x, --extract&lt;/code&gt; -&amp;gt; to extract from an existing archive.&lt;br&gt;
&lt;code&gt;-t, --list&lt;/code&gt;    -&amp;gt; to list an archive's content.&lt;br&gt;
&lt;code&gt;-u, --update&lt;/code&gt;  -&amp;gt; to update the existing files in the archive with a newer version.&lt;br&gt;
&lt;code&gt;-r, --append&lt;/code&gt;  -&amp;gt; to appends files to an existing archive.&lt;br&gt;
&lt;code&gt;--delete&lt;/code&gt;      -&amp;gt; to deletes a member from the archive.&lt;br&gt;
&lt;code&gt;-v, --verbose&lt;/code&gt; -&amp;gt; to shows which files get archived or extracted.&lt;br&gt;
&lt;code&gt;-f, --file=&lt;/code&gt;   -&amp;gt; to specifies the file or &lt;br&gt;
specifying filename as archive argument to operate.&lt;br&gt;
&lt;code&gt;-p, --preserve-permissions&lt;/code&gt; -&amp;gt; to control file permissions with tar when extracting an archive.&lt;br&gt;
&lt;code&gt;-z, --gzip&lt;/code&gt;    -&amp;gt; to use gzip compression (.tar.gz) &lt;br&gt;
&lt;code&gt;-j, --bzip2&lt;/code&gt;   -&amp;gt; to use bzip2 compression (.tar.bz2) &lt;br&gt;
&lt;code&gt;-J, --xz&lt;/code&gt;      -&amp;gt; to use xz compression (.tar.xz) &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Tar Command Syntax and Example&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;a. Create a tar Archive&lt;/strong&gt;&lt;br&gt;
To make a tar archive, use :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tar -cf &amp;lt;archive name&amp;gt;.tar file
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;For example, create an archive named agung.tar with the contents of biodata in the user's home directory :
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[user@host ~]$tar -cf agung.tar biodata
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;b. Extracting Files from an Archive&lt;/strong&gt;&lt;br&gt;
For extracting from a tar archive use :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tar -xf &amp;lt;archive name&amp;gt;.tar
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;For example, create an archive named myAddress.tar, then extract it in the Address directory as content as user root :
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[root@host ~]# mkdir Address
[root@host ~]# cd Address
[root@host Address]# tar -xf myAddress.tar
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;c. Creating a Compressed Archive&lt;/strong&gt;&lt;br&gt;
To create a tar.gz Compressed Archive, use :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tar czf &amp;lt;archive name&amp;gt;.tar.gz &amp;lt;file or location&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;For exmple, create a gzip compressed archive named agung.tar.gz, with the contents from the alamat directory on host :
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[root@host ~]# tar -czf agung.tar.gz alamat
tar: Removing leading `/' from member names
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;d. List Archive Contents&lt;/strong&gt;&lt;br&gt;
Use the following command to list an archive's contents :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tar -tf files.tar.gz
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;For example, list the files and directories in the files.tar archive :
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[root@host ~]#tar tf files.tar.gz
files
files/file1.txt
files/file2.txt
files/file3.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;u&gt;&lt;strong&gt;TRANSFERRING FILES&lt;/strong&gt;&lt;/u&gt; &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1 . Transferring Files Using (SCP)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SCP DEFINITION&lt;/strong&gt;&lt;br&gt;
SCP (Secure Copy Protocol) is the command line used to securely copy files and directories between two locations. SCP protects your data while copying across an SSH (Secure Shell) connection by encrypting the files and the passwords. Therefore, even if the traffic is intercepted, the information is still encrypted.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use SCP when :&lt;/strong&gt;&lt;br&gt;
a. Copying files from a local host to a remote host.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For example, to copy contoh files from local host to remote server, you use:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;scp Desktop/contoh.txt root@146.174.142.28:/home/tugas_agung
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Desktop/contoh.txt&lt;/strong&gt; -the name of the file being copied and its location.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="mailto:root@146.174.142.28"&gt;root@146.174.142.28&lt;/a&gt;&lt;/strong&gt; - the username and IP address of the remote server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;/home/tugas_agung&lt;/strong&gt; –the location where to store the copied file.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;b. Copying files from a remote host to a local host.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For example, to copy a contoh file from a remote host to a local host, you use :
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;scp 147.182.143.27:/home/tugas_agung/contoh.txt home/tugas
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="mailto:root@147.182.143.27"&gt;root@147.182.143.27&lt;/a&gt;&lt;/strong&gt; -the username and IP address of the remote server from where the file is currently located.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;/home/tugas_agung/contoh.txt&lt;/strong&gt; -the name of the file being copied and its location.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;home/tugas&lt;/strong&gt; –the location where to store the copied file.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;c. Copy a File from One Remote Server to Another&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For example, to copy a file from one remote server to another remote server using the scp command :
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;scp root@147.182.143.27:/home/tugas_agung/contoh.txt looctos@146.153.129.25:home/tugas 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="mailto:root@147.182.143.27"&gt;root@147.182.143.27&lt;/a&gt;&lt;/strong&gt; -the username and IP address of the remote server from where the file is currently located.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;/home/tugas_agung/contoh.txt&lt;/strong&gt; -the name of the file being copied and its location.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="mailto:looctos@146.153.129.25"&gt;looctos@146.153.129.25&lt;/a&gt;&lt;/strong&gt; -the username and IP address of the remote server where we want to copy the file.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;home/tugas&lt;/strong&gt; –the location where to store the copied file on the remote server.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;2. Transferring Files Using (SFTP)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SFTP DEFINITION&lt;/strong&gt;&lt;br&gt;
SFTP (Secure File Transfer Protocol) is a file transfer protocol that uses SSH encryption to transfer files between systems securely.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example to Transfer Files Using SFTP&lt;/strong&gt;&lt;br&gt;
a. Transfer Remote Files to a Local System&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&lt;br&gt;
 Use the get command in the SFTP interface to transfer a file from a remote server to your local system:&lt;br&gt;
&lt;/p&gt;


&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;get [path to file]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;b. Transfer Local Files to a Remote Server&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&lt;br&gt;
To transfer files from a local system to a remote server, use the put command. The put command uses the same syntax and options as the get command.&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;put [path to file]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;THAT'S ALL FROM ME, THANKS&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>tar</category>
      <category>scp</category>
      <category>sftp</category>
    </item>
  </channel>
</rss>
