<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Command-Line on Details...</title>
    <link>https://www.deepreflect.net/tags/command-line/</link>
    <description>Recent content in Command-Line on Details...</description>
    <generator>Hugo</generator>
    <language>en-US</language>
    <copyright>Copyright © 2003 - 2026 Leonardo Rizzi</copyright>
    <lastBuildDate>Tue, 30 Jun 2026 03:28:29 +0200</lastBuildDate>
    <atom:link href="https://www.deepreflect.net/tags/command-line/feed.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>OpenVMS - Command line editing</title>
      <link>https://www.deepreflect.net/2010/02/24/openvms-command-line-editing/</link>
      <pubDate>Wed, 24 Feb 2010 17:35:26 +0000</pubDate>
       <guid isPermaLink="false">http://blog.deepreflect.net/?p=840</guid> 
      <description>&lt;p&gt;DCL implements command line editing and recall, so that users can more easily correct typing errors and reuse previous command lines.&lt;/p&gt;
&lt;p&gt;Recall buffer: access to recently issued commands&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-fallback&#34; data-lang=&#34;fallback&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$ RECALL string   Bring up last command beginning with string.
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$ RECALL/ALL      Displays all commands and their numbers.
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$ RECALL number   Use a number found  in RECALL/ALL.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Command line editing (if it isn&amp;rsquo;t on, do: $ SET TERM/LINE):&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-fallback&#34; data-lang=&#34;fallback&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$ {up-arrow}      Previous command in recall buffer.
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$ {down-arrow}    Next command in recall buffer.
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$ {Ctrl A}        Toggle insert/overstrike editing.
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$ {Ctrl D}        Move one character left.
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$ {Ctrl E}        Move to the end of the line.
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$ {Ctrl F}        Move one character right.
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$ {Ctrl H}        Move to the beginning of the line.
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$ {Ctrl J}        Delete word left of cursor.
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$ {Ctrl R}        Rewrite the command line.
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$ {Ctrl U}        Delete line left of cursor.
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$ {Ctrl X}        Cancel the current command line.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Miscellaneous:&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>DCL implements command line editing and recall, so that users can more easily correct typing errors and reuse previous command lines.</p>
<p>Recall buffer: access to recently issued commands</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>$ RECALL string   Bring up last command beginning with string.
</span></span><span style="display:flex;"><span>$ RECALL/ALL      Displays all commands and their numbers.
</span></span><span style="display:flex;"><span>$ RECALL number   Use a number found  in RECALL/ALL.
</span></span></code></pre></div><p>Command line editing (if it isn&rsquo;t on, do: $ SET TERM/LINE):</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>$ {up-arrow}      Previous command in recall buffer.
</span></span><span style="display:flex;"><span>$ {down-arrow}    Next command in recall buffer.
</span></span><span style="display:flex;"><span>$ {Ctrl A}        Toggle insert/overstrike editing.
</span></span><span style="display:flex;"><span>$ {Ctrl D}        Move one character left.
</span></span><span style="display:flex;"><span>$ {Ctrl E}        Move to the end of the line.
</span></span><span style="display:flex;"><span>$ {Ctrl F}        Move one character right.
</span></span><span style="display:flex;"><span>$ {Ctrl H}        Move to the beginning of the line.
</span></span><span style="display:flex;"><span>$ {Ctrl J}        Delete word left of cursor.
</span></span><span style="display:flex;"><span>$ {Ctrl R}        Rewrite the command line.
</span></span><span style="display:flex;"><span>$ {Ctrl U}        Delete line left of cursor.
</span></span><span style="display:flex;"><span>$ {Ctrl X}        Cancel the current command line.
</span></span></code></pre></div><p>Miscellaneous:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>$ {Ctrl 3}        ASCII code for {Esc}.
</span></span><span style="display:flex;"><span>$ {Ctrl I}        ASCII code for {Tab}.
</span></span><span style="display:flex;"><span>$ {Ctrl Z}        Tell DCL &#34;end of file&#34;. Used in some programs
</span></span><span style="display:flex;"><span>to indicate more general sorts of &#34;end&#34; commands.
</span></span></code></pre></div><p>Of these, only {Ctrl I} will insert a character into the command line,
rather than just move the cursor around. No new characters may be
inserted before a tab ({Ctrl I}) in a command line, but existing characters
may be changed in overstrike mode, or deleted. This behavior is documented in the &ldquo;I/O User&rsquo;s Guide&rdquo; and has existed since VMS 4.0.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Windows - Change IP from command line</title>
      <link>https://www.deepreflect.net/2009/02/01/windows-change-ip-form-command-line/</link>
      <pubDate>Sun, 01 Feb 2009 19:36:22 +0000</pubDate>
       <guid isPermaLink="false">http://blog.deepreflect.net/?p=394</guid> 
      <description>&lt;p&gt;Yes, is possibile don&amp;rsquo;t make lot of click to reconfigure network interfaces under Windows, using &amp;ldquo;netsh&amp;rdquo; command like this:&lt;/p&gt;
&lt;p&gt;For set up static address and metric 1 gateway:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-fallback&#34; data-lang=&#34;fallback&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;netsh interface ip set address name=&amp;#34;Local Area Connection&amp;#34; static ip.ip.ip.ip 255.255.255.0 gw.gw.gw.gw 1
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;For set up static dns:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-fallback&#34; data-lang=&#34;fallback&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;netsh interface ip set dns &amp;#34;Local Area Connection&amp;#34; static xx.xx.xx.xx
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;netsh add dns &amp;#34;Local Area Connection&amp;#34; addr=xx.xx.xx.xx index=2
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;For setup ip by dhcp:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-fallback&#34; data-lang=&#34;fallback&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;netsh interface ip set address name=&amp;#34;Local Area Connection&amp;#34; source=dhcp
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;netsh interface ip set dns name=&amp;#34;Local Area Connection&amp;#34; source=dhcp
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
      <content:encoded><![CDATA[<p>Yes, is possibile don&rsquo;t make lot of click to reconfigure network interfaces under Windows, using &ldquo;netsh&rdquo; command like this:</p>
<p>For set up static address and metric 1 gateway:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>netsh interface ip set address name=&#34;Local Area Connection&#34; static ip.ip.ip.ip 255.255.255.0 gw.gw.gw.gw 1
</span></span></code></pre></div><p>For set up static dns:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>netsh interface ip set dns &#34;Local Area Connection&#34; static xx.xx.xx.xx
</span></span><span style="display:flex;"><span>netsh add dns &#34;Local Area Connection&#34; addr=xx.xx.xx.xx index=2
</span></span></code></pre></div><p>For setup ip by dhcp:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>netsh interface ip set address name=&#34;Local Area Connection&#34; source=dhcp
</span></span><span style="display:flex;"><span>netsh interface ip set dns name=&#34;Local Area Connection&#34; source=dhcp
</span></span></code></pre></div>]]></content:encoded>
    </item>
    <item>
      <title>Linux - Send mail from command line</title>
      <link>https://www.deepreflect.net/2009/01/26/linux-send-mail-from-command-line/</link>
      <pubDate>Mon, 26 Jan 2009 03:28:56 +0000</pubDate>
       <guid isPermaLink="false">http://blog.deepreflect.net/?p=377</guid> 
      <description>&lt;p&gt;The Linux command line can be very powerful once you know how to use it. You can parse data, monitor&lt;/p&gt;
&lt;p&gt;Mutt:
One of major drawbacks of using the mail command is that it does not support the sending of attachments. mutt, on the other hand, does support it. I’ve found this feature particularly useful for scripts that generate non-textual reports or backups which are relatively small in size which I’d like to backup elsewhere. Of course, mutt allows you to do a lot more than just send attachments. It is a much more complete command line mail client than the “mail” command. Right now we’ll just explore the basic stuff we might need often. Here’s how you would attach a file to a mail:&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>The Linux command line can be very powerful once you know how to use it. You can parse data, monitor</p>
<p>Mutt:
One of major drawbacks of using the mail command is that it does not support the sending of attachments. mutt, on the other hand, does support it. I’ve found this feature particularly useful for scripts that generate non-textual reports or backups which are relatively small in size which I’d like to backup elsewhere. Of course, mutt allows you to do a lot more than just send attachments. It is a much more complete command line mail client than the “mail” command. Right now we’ll just explore the basic stuff we might need often. Here’s how you would attach a file to a mail:</p>
<p><code># echo &quot;Sending an attachment.&quot; | mutt -a backup.zip -s &quot;attachment&quot; leo@deepreflect.net</code></p>
<p>This command will send a mail to <a href="mailto:leo@deepreflect.net">leo@deepreflect.net</a> with the subject (-s) “attachment”, the body text &ldquo;Sending an attachment.&rdquo;, containing the attachment (-a) backup.zip. Like with the mail command you can use the “-c” option to mark a copy to another mail id.
Shell scripting:
Now, with the basics covered you can send mails from your shell scripts. Here’s a simple shell script that gives you a reading of the usage of space on your partitions and mails the data to you.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#75715e">#!/bin/bash
</span></span></span><span style="display:flex;"><span>df -h | mail -s <span style="color:#e6db74">&#34;disk space report&#34;</span> leo@deepreflect.net
</span></span></code></pre></div><p>Save these lines in a file on your Linux server and run it. You should receive a mail containing the results of the command. If, however, you need to send more data than just this you will need to write the data to a text file and enter it into the mail body while composing the mail. Here’s and example of a shell script that gets the disk usage as well as the memory usage, writes the data into a temporary file, and then enters it all into the body of the mail being sent out:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#75715e">#!/bin/bash
</span></span></span><span style="display:flex;"><span>df -h &gt; /tmp/mail_report.log
</span></span><span style="display:flex;"><span>free -m &gt;&gt; /tmp/mail_report.log
</span></span><span style="display:flex;"><span>mail -s <span style="color:#e6db74">&#34;disk and RAM report&#34;</span> leo@deepreflect.net &lt; /tmp/mail_report.log
</span></span></code></pre></div><p>Now here’s a more complicated problem. You have to take a backup of a few files and mail then out. First the directory to be mailed out is archived. Then it is sent as an email attachment using mutt. Here’s a script to do just that:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#75715e">#!/bin/bash
</span></span></span><span style="display:flex;"><span>tar -zcf /tmp/backup.tar.gz  /home/leo/files
</span></span><span style="display:flex;"><span>echo | mutt -a -s /tmp/backup.tar.gz <span style="color:#e6db74">&#34;daily backup of data&#34;</span> leo@deepreflect.net
</span></span></code></pre></div><p>The echo at the start of the last line adds a blank into the body of the mail being set out.</p>
]]></content:encoded>
    </item>
  </channel>
</rss>
