<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Exec on Amit Agarwal Linux Blog</title>
    <link>/tags/exec/</link>
    <description>Recent content in Exec on Amit Agarwal Linux Blog</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Thu, 15 Jul 2010 02:10:28 +0000</lastBuildDate>
    
	<atom:link href="/tags/exec/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>concatenate compressed and uncompressed logs</title>
      <link>/2010/07/15/concatenate-compressed-and-uncompressed-logs/</link>
      <pubDate>Thu, 15 Jul 2010 02:10:28 +0000</pubDate>
      
      <guid>/2010/07/15/concatenate-compressed-and-uncompressed-logs/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;h1 id=&#34;span-stylefont-size-x-largea-hrefhttpfeedproxygooglecomrcommand-line-fu3iwfuyltygjmconcatenate-compressed-and-uncompressed-logsconcatenate-compressed-and-uncompressed-logsaspan&#34;&gt;&lt;strong&gt;&amp;lt;span style=&amp;quot;font-size: x-large;&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;http://feedproxy.google.com/~r/Command-line-fu/~3/iwFUyltYgjM/concatenate-compressed-and-uncompressed-logs&amp;quot;&amp;gt;concatenate compressed and uncompressed logs&lt;/a&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/h1&gt;
&lt;p&gt;&lt;tt&gt;$ find /var/log/apache2 -name &#39;access.log&lt;em&gt;gz&#39; -exec &amp;lt;a class=&amp;quot;zem_slink freebase/guid/9202a8c04000641f800000000001abd9&amp;quot; title=&amp;quot;Gzip&amp;quot; rel=&amp;quot;homepage&amp;quot; href=&amp;quot;http://www.gzip.org/&amp;quot;&amp;gt;zcat&lt;/a&gt; {} ; -or -name &#39;access.log&lt;/em&gt;&#39; -exec cat {} ;&lt;/tt&gt; This command allows you to stream your log files, including gziped files, into one stream which can be piped to &amp;lt;a class=&amp;quot;zem_slink freebase/guid/9202a8c04000641f800000000000584b&amp;quot; title=&amp;quot;AWK&amp;quot; rel=&amp;quot;homepage&amp;quot; href=&amp;quot;http://cm.bell-labs.com/cm/cs/awkbook/index.html&amp;quot;&amp;gt;awk&lt;/a&gt; or some other command for analysis.&lt;/p&gt;
&lt;p&gt;Note: if your version of &amp;amp;#8217;find&amp;amp;#8217; supports it, use:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>The power of find command in Linux – advanced.</title>
      <link>/2010/05/24/the-power-of-find-command-in-linux-advanced/</link>
      <pubDate>Mon, 24 May 2010 16:25:40 +0000</pubDate>
      
      <guid>/2010/05/24/the-power-of-find-command-in-linux-advanced/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Generally whoever uses Linux, would know about the find command. Find the man page &amp;lt;a href=&amp;quot;http://amit.themafia.info/phpMan.php?parameter=find&amp;amp;mode=man&amp;quot; target=&amp;quot;_blank&amp;quot;&amp;gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;There are also lots of blogs, tutorials and other articles on find command on the web, so why write another one. Because it&amp;amp;#8217;s worth every word spent on it 🙂&lt;br&gt;
find is a very powerful command, let&amp;amp;#8217;s see how (options for find command from man page and usage):&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;–&lt;strong&gt;depth&lt;/strong&gt; — Process each directory&amp;amp;#8217;s contents before the directory itself.&lt;br&gt;
–&lt;strong&gt;maxdepth&lt;/strong&gt; — Descend at most &amp;lt;span style=&amp;quot;text-decoration: underline;&amp;quot;&amp;gt;levels&lt;/span&gt; (a non-negative integer) levels of directories below the command line arguments.&lt;br&gt;
–&lt;strong&gt;xdev&lt;/strong&gt; — Don&amp;amp;#8217;t descend directories on other filesystems.&lt;br&gt;
–&lt;strong&gt;executable&lt;/strong&gt; — Matches files which are executable and directories which are searchable (in a file name resolution sense).&lt;br&gt;
This takes into account access control lists and other permissions artefacts which the &lt;strong&gt;-perm&lt;/strong&gt; test ignores.&lt;br&gt;
–&lt;strong&gt;iname&lt;/strong&gt; — Like &lt;strong&gt;-name&lt;/strong&gt;, but the match is case insensitive.&lt;br&gt;
–&lt;strong&gt;nogroup&lt;/strong&gt; — No group corresponds to file&amp;amp;#8217;s numeric group ID.&lt;br&gt;
–&lt;strong&gt;nouser&lt;/strong&gt; — No user corresponds to file&amp;amp;#8217;s numeric user ID.&lt;br&gt;
–&lt;strong&gt;fls&lt;/strong&gt; &amp;lt;span style=&amp;quot;text-decoration: underline;&amp;quot;&amp;gt;file&lt;/span&gt; — True; like &lt;strong&gt;-ls&lt;/strong&gt; but write to &amp;lt;span style=&amp;quot;text-decoration: underline;&amp;quot;&amp;gt;file&lt;/span&gt; like &lt;strong&gt;-fprint&lt;/strong&gt;.&lt;br&gt;
–&lt;strong&gt;ok&lt;/strong&gt; &amp;lt;span style=&amp;quot;text-decoration: underline;&amp;quot;&amp;gt;command&lt;/span&gt; — Like &lt;strong&gt;-exec&lt;/strong&gt; but ask the user first (on the standard input);&lt;br&gt;
–&lt;strong&gt;print0&lt;/strong&gt; — True; print the full file name on the standard output, followed by a null character&lt;br&gt;
(instead of the newline character that &lt;strong&gt;-print&lt;/strong&gt; uses).&lt;br&gt;
–&lt;strong&gt;printf&lt;/strong&gt; &amp;lt;span style=&amp;quot;text-decoration: underline;&amp;quot;&amp;gt;format&lt;/span&gt; — True; print &amp;lt;span style=&amp;quot;text-decoration: underline;&amp;quot;&amp;gt;format&lt;/span&gt; on the standard output, interpreting &amp;amp;#8217;&amp;amp;#8217; escapes and &amp;amp;#8217;%&amp;amp;#8217; directives.&lt;/p&gt;</description>
    </item>
    
  </channel>
</rss>
