Skip to content

Commit b161346

Browse files
committed
🤖 Auto-update eBook files and GitHub Pages [skip ci]
1 parent 07f4629 commit b161346

File tree

7 files changed

+106
-20
lines changed

7 files changed

+106
-20
lines changed
238 Bytes
Binary file not shown.
289 Bytes
Binary file not shown.
145 Bytes
Binary file not shown.

ebook/en/export/101-linux-commands.html

Lines changed: 53 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4042,19 +4042,62 @@ <h3>Additional Flags and their Functionalities</h3>
40424042
</tbody>
40434043
</table>
40444044
<div style="page-break-after: always;"></div><h1>The <code>curl</code> command</h1>
4045-
<p>In linux, <code>curl</code> is a tool to transfer data from or to a server, using one of the supported protocols(DICT, FILE ,FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET and TFTP).</p>
4046-
<h2>Example :</h2>
4047-
<pre><code class="language-bash hljs bash" data-lang="bash">$ curl example.com
4045+
<p>In Linux, curl is a powerful command-line tool used to transfer data from or to a server using a wide variety of protocols, including HTTP, HTTPS, and FTP. It is often used for testing APIs, downloading files, and automating web-related tasks.</p>
4046+
<h2>The syntax of the <code>curl</code> command :</h2>
4047+
<pre><code class="language-bash hljs bash" data-lang="bash">$ curl [options...] &lt;url&gt;
40484048
</code></pre>
40494049
<p>The command will print the source code of the example.com homepage in the terminal window.</p>
4050-
<h2>The syntax of the <code>curl</code> command is :</h2>
4051-
<pre><code class="language-bash hljs bash" data-lang="bash">$ curl [options...] &lt;url&gt;
4050+
<h2>Common Options :</h2>
4051+
<p>curl has over 200 options! Here are some of the most common and useful ones.</p>
4052+
<table>
4053+
<thead>
4054+
<tr>
4055+
<th>Option</th>
4056+
<th>Long Version</th>
4057+
<th>Description</th>
4058+
</tr>
4059+
</thead>
4060+
<tbody>
4061+
<tr>
4062+
<td><code>-O</code></td>
4063+
<td><code>--remote-name</code></td>
4064+
<td>Downloads the file and saves it with the same name as the remote file.</td>
4065+
</tr>
4066+
<tr>
4067+
<td><code>-o &lt;file&gt;</code></td>
4068+
<td><code>--output &lt;file&gt;</code></td>
4069+
<td>Saves the downloaded output to a specific filename.</td>
4070+
</tr>
4071+
<tr>
4072+
<td><code>-L</code></td>
4073+
<td><code>--location</code></td>
4074+
<td>Follows redirects if the server reports that the requested page has moved.</td>
4075+
</tr>
4076+
<tr>
4077+
<td><code>-X &lt;METHOD&gt;</code></td>
4078+
<td><code>--request &lt;METHOD&gt;</code></td>
4079+
<td>Specifies the HTTP request method to use (e.g., POST, PUT, DELETE).</td>
4080+
</tr>
4081+
<tr>
4082+
<td><code>-H &lt;header&gt;</code></td>
4083+
<td><code>--header &lt;header&gt;</code></td>
4084+
<td>Allows you to add a custom HTTP header to your request.</td>
4085+
</tr>
4086+
</tbody>
4087+
</table>
4088+
<h2>Examples :</h2>
4089+
<h3>1. View the source code of a webpage</h3>
4090+
<p>This is the simplest use of curl. It will fetch the content from the URL and print its HTML source code directly to your terminal.</p>
4091+
<pre><code class="language-bash hljs bash" data-lang="bash">$ curl example.com
4092+
</code></pre>
4093+
<h3>2. Download a file</h3>
4094+
<p>The -O flag is used to download a file. curl will save it in your current directory using the same name as the remote file.</p>
4095+
<pre><code class="language-bash hljs bash" data-lang="bash">$ curl -O https://github.com/bobbyiliev/101-linux-commands/archive/refs/tags/v1.0.zip
4096+
</code></pre>
4097+
<h3>3. Download a file and rename it</h3>
4098+
<p>Using the -o flag, you can specify a new name for the downloaded file.</p>
4099+
<pre><code class="language-bash hljs bash" data-lang="bash">$ curl -o linux-commands.zip https://github.com/bobbyiliev/101-linux-commands/archive/refs/tags/v1.0.zip
40524100
</code></pre>
4053-
<h2>Options :</h2>
4054-
<p>Options start with one or two dashes. Many of the options require an additional value next to them.</p>
4055-
<p>The short &quot;single-dash&quot; form of the options, <code>-d</code> for example, may be used with or without a space between it and its value, although a space is a recommended separator. The long &quot;double-dash&quot; form, <code>-d</code>, <code>--data</code> for example, requires a space between it and its value.</p>
4056-
<p>Short version options that don't need any additional values can be used immediately next to each other, like for example you can specify all the options <code>-O</code>, <code>-L</code> and <code>-v</code> at once as <code>-OLv</code>.</p>
4057-
<p>In general, all boolean options are enabled with <code>--option</code> and yet again disabled with <code>--no-option</code>. That is, you use the exact same option name but prefix it with <code>no-</code>. However, in this list we mostly only list and show the <code>--option</code> version of them. (This concept with <code>--no</code> options was added in 7.19.0. Previously most options were toggled on/off through repeated use of the same command line option.)</p>
40584101
<h2>Installation:</h2>
40594102
<p>The curl command comes with most of the Linux distributions. But, if the system does not carry the curl by default. You need to install it manually. To install the curl, execute the following commands:</p>
40604103
<p>Update the system by executing the following commands:</p>
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

index.html

Lines changed: 53 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4042,19 +4042,62 @@ <h3>Additional Flags and their Functionalities</h3>
40424042
</tbody>
40434043
</table>
40444044
<div style="page-break-after: always;"></div><h1>The <code>curl</code> command</h1>
4045-
<p>In linux, <code>curl</code> is a tool to transfer data from or to a server, using one of the supported protocols(DICT, FILE ,FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET and TFTP).</p>
4046-
<h2>Example :</h2>
4047-
<pre><code class="language-bash hljs bash" data-lang="bash">$ curl example.com
4045+
<p>In Linux, curl is a powerful command-line tool used to transfer data from or to a server using a wide variety of protocols, including HTTP, HTTPS, and FTP. It is often used for testing APIs, downloading files, and automating web-related tasks.</p>
4046+
<h2>The syntax of the <code>curl</code> command :</h2>
4047+
<pre><code class="language-bash hljs bash" data-lang="bash">$ curl [options...] &lt;url&gt;
40484048
</code></pre>
40494049
<p>The command will print the source code of the example.com homepage in the terminal window.</p>
4050-
<h2>The syntax of the <code>curl</code> command is :</h2>
4051-
<pre><code class="language-bash hljs bash" data-lang="bash">$ curl [options...] &lt;url&gt;
4050+
<h2>Common Options :</h2>
4051+
<p>curl has over 200 options! Here are some of the most common and useful ones.</p>
4052+
<table>
4053+
<thead>
4054+
<tr>
4055+
<th>Option</th>
4056+
<th>Long Version</th>
4057+
<th>Description</th>
4058+
</tr>
4059+
</thead>
4060+
<tbody>
4061+
<tr>
4062+
<td><code>-O</code></td>
4063+
<td><code>--remote-name</code></td>
4064+
<td>Downloads the file and saves it with the same name as the remote file.</td>
4065+
</tr>
4066+
<tr>
4067+
<td><code>-o &lt;file&gt;</code></td>
4068+
<td><code>--output &lt;file&gt;</code></td>
4069+
<td>Saves the downloaded output to a specific filename.</td>
4070+
</tr>
4071+
<tr>
4072+
<td><code>-L</code></td>
4073+
<td><code>--location</code></td>
4074+
<td>Follows redirects if the server reports that the requested page has moved.</td>
4075+
</tr>
4076+
<tr>
4077+
<td><code>-X &lt;METHOD&gt;</code></td>
4078+
<td><code>--request &lt;METHOD&gt;</code></td>
4079+
<td>Specifies the HTTP request method to use (e.g., POST, PUT, DELETE).</td>
4080+
</tr>
4081+
<tr>
4082+
<td><code>-H &lt;header&gt;</code></td>
4083+
<td><code>--header &lt;header&gt;</code></td>
4084+
<td>Allows you to add a custom HTTP header to your request.</td>
4085+
</tr>
4086+
</tbody>
4087+
</table>
4088+
<h2>Examples :</h2>
4089+
<h3>1. View the source code of a webpage</h3>
4090+
<p>This is the simplest use of curl. It will fetch the content from the URL and print its HTML source code directly to your terminal.</p>
4091+
<pre><code class="language-bash hljs bash" data-lang="bash">$ curl example.com
4092+
</code></pre>
4093+
<h3>2. Download a file</h3>
4094+
<p>The -O flag is used to download a file. curl will save it in your current directory using the same name as the remote file.</p>
4095+
<pre><code class="language-bash hljs bash" data-lang="bash">$ curl -O https://github.com/bobbyiliev/101-linux-commands/archive/refs/tags/v1.0.zip
4096+
</code></pre>
4097+
<h3>3. Download a file and rename it</h3>
4098+
<p>Using the -o flag, you can specify a new name for the downloaded file.</p>
4099+
<pre><code class="language-bash hljs bash" data-lang="bash">$ curl -o linux-commands.zip https://github.com/bobbyiliev/101-linux-commands/archive/refs/tags/v1.0.zip
40524100
</code></pre>
4053-
<h2>Options :</h2>
4054-
<p>Options start with one or two dashes. Many of the options require an additional value next to them.</p>
4055-
<p>The short &quot;single-dash&quot; form of the options, <code>-d</code> for example, may be used with or without a space between it and its value, although a space is a recommended separator. The long &quot;double-dash&quot; form, <code>-d</code>, <code>--data</code> for example, requires a space between it and its value.</p>
4056-
<p>Short version options that don't need any additional values can be used immediately next to each other, like for example you can specify all the options <code>-O</code>, <code>-L</code> and <code>-v</code> at once as <code>-OLv</code>.</p>
4057-
<p>In general, all boolean options are enabled with <code>--option</code> and yet again disabled with <code>--no-option</code>. That is, you use the exact same option name but prefix it with <code>no-</code>. However, in this list we mostly only list and show the <code>--option</code> version of them. (This concept with <code>--no</code> options was added in 7.19.0. Previously most options were toggled on/off through repeated use of the same command line option.)</p>
40584101
<h2>Installation:</h2>
40594102
<p>The curl command comes with most of the Linux distributions. But, if the system does not carry the curl by default. You need to install it manually. To install the curl, execute the following commands:</p>
40604103
<p>Update the system by executing the following commands:</p>

0 commit comments

Comments
 (0)