<?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>Forem: Avinash Sivaraman</title>
    <description>The latest articles on Forem by Avinash Sivaraman (@avinashsivaram).</description>
    <link>https://forem.com/avinashsivaram</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%2F40918%2Ffba0f910-9610-41a6-b9cd-80e641fc3f83.jpg</url>
      <title>Forem: Avinash Sivaraman</title>
      <link>https://forem.com/avinashsivaram</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/avinashsivaram"/>
    <language>en</language>
    <item>
      <title>⚡️ Lighting blaze file content copying to the Clipboard (Mac) 💻</title>
      <dc:creator>Avinash Sivaraman</dc:creator>
      <pubDate>Tue, 02 Jun 2020 02:24:05 +0000</pubDate>
      <link>https://forem.com/avinashsivaram/copying-a-file-to-the-clipboard-mac-32b9</link>
      <guid>https://forem.com/avinashsivaram/copying-a-file-to-the-clipboard-mac-32b9</guid>
      <description>&lt;p&gt;Have you ever tried to copy the content of a file and paste it somewhere else like copying a JSON file and pasting it in some website. When you want to copy a file, we need to open a file and select all the content by command + A (or using the mouse) and copying the content of the file. &lt;/p&gt;

&lt;p&gt;Here is the trick to copy the content directly from the terminal.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;pbcopy &amp;lt; filename.txt
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;We can simplify the command by adding an alias in our .bashrc file. So, we don't need to type this whole command to copy the content. Open the .bashrc in vim or any other editor of your choice.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt; vim ~/.bashrc
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Add the below line inside the .bashrc file and save it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;alias &lt;/span&gt;&lt;span class="nv"&gt;cc&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'pbcopy &amp;lt;'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Now we need to restart the terminal or run the below command in the terminal to see our alias in action.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;source&lt;/span&gt; ~/.bashrc
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Finally, you can copy the content of the file by using the cc command and this command is local to your machine.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;cc demo.txt
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Happy Coding 💻. You can find my personal &lt;a href="https://gist.github.com/avinashsivaraman/7858311a4269ac912d72dd7b4a05c140"&gt;.bashrc&lt;/a&gt; file which contains a lot of GitHub and npm shortcuts &lt;a href="https://gist.github.com/avinashsivaraman/7858311a4269ac912d72dd7b4a05c140"&gt;here&lt;/a&gt;. I am really happy to discuss more tips and tricks to improve productivity. Feel free to comment down below ⬇️&lt;/p&gt;

</description>
      <category>mactricks</category>
      <category>bash</category>
      <category>productivity</category>
      <category>terminal</category>
    </item>
  </channel>
</rss>
