<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Basics on Artur Meski</title>
    <link>https://meski.io/tags/basics/</link>
    <description>Recent content in Basics on Artur Meski</description>
    <generator>Hugo</generator>
    <language>en-gb</language>
    <lastBuildDate>Sat, 19 Jun 2021 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://meski.io/tags/basics/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Reading and monitoring files on Linux</title>
      <link>https://meski.io/posts/reading-and-monitoring-files/</link>
      <pubDate>Sat, 19 Jun 2021 00:00:00 +0000</pubDate>
      <guid>https://meski.io/posts/reading-and-monitoring-files/</guid>
      <description>&lt;p&gt;Let&amp;rsquo;s start with something super basic. To print the contents of a file you can use &lt;code&gt;cat&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;cat file&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This tool is simple but really powerful when combined (piped) with other commands.&#xA;However, &lt;code&gt;cat&lt;/code&gt; is not very practical if you just want to see the contents of a larger file.&#xA;In that case you can use &lt;code&gt;less&lt;/code&gt;, which also allows you to conveniently browse your file:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;press &lt;em&gt;space&lt;/em&gt; for &lt;em&gt;page down&lt;/em&gt; or &lt;code&gt;b&lt;/code&gt; for &lt;em&gt;page up&lt;/em&gt;,&lt;/li&gt;&#xA;&lt;li&gt;type &lt;code&gt;/pattern&lt;/code&gt; to search for &lt;code&gt;pattern&lt;/code&gt; in the file (&lt;code&gt;n&lt;/code&gt; jumps to the next occurence, while &lt;code&gt;N&lt;/code&gt; jumps to the previous one),&lt;/li&gt;&#xA;&lt;li&gt;press &lt;code&gt;q&lt;/code&gt; to quit.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;If you need to watch a certain file (typically a log file), you can simply use &lt;code&gt;tail -f&lt;/code&gt;:&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
