Skip to content

Commit

Permalink
Site updated at 2014-02-02 18:14:54 UTC
Browse files Browse the repository at this point in the history
  • Loading branch information
marcocattai committed Feb 2, 2014
1 parent 2bc83d9 commit 96b50b8
Show file tree
Hide file tree
Showing 38 changed files with 2,442 additions and 22 deletions.
244 changes: 243 additions & 1 deletion atom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title><![CDATA[Marco Cattai]]></title>
<link href="http://marcocattai.github.io/atom.xml" rel="self"/>
<link href="http://marcocattai.github.io/"/>
<updated>2014-02-02T17:43:11+00:00</updated>
<updated>2014-02-02T18:13:28+00:00</updated>
<id>http://marcocattai.github.io/</id>
<author>
<name><![CDATA[Marco Cattai]]></name>
Expand All @@ -13,6 +13,248 @@
<generator uri="http://octopress.org/">Octopress</generator>


<entry>
<title type="html"><![CDATA[Linux - snippets]]></title>
<link href="http://marcocattai.github.io/blog/2011/06/10/linux-snippets/"/>
<updated>2011-06-10T18:52:14+01:00</updated>
<id>http://marcocattai.github.io/blog/2011/06/10/linux-snippets</id>
<content type="html"><![CDATA[<p>
Search all the files/folder with that name and remove them
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='sh'><span class='line'> find . -name <span class="s2">&quot;FILE-TO-FIND&quot;</span>-exec rm -rf <span class="o">{}</span> <span class="se">\;</span>
</span></code></pre></td></tr></table></div></figure>
</p>
<p>
Find all files having .bak (*.bak) extension in current directory and remove them:
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='sh'><span class='line'> find . -type f -name <span class="s2">&quot;*.bak&quot;</span> -exec rm -f <span class="o">{}</span> <span class="se">\;</span>
</span></code></pre></td></tr></table></div></figure>
</p>
<p>
Find all core files and remove them
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='sh'><span class='line'> find / -name core -exec rm -f <span class="o">{}</span> <span class="se">\;</span>
</span></code></pre></td></tr></table></div></figure>
</p>
<p>
Find all *.bak files in current directory and removes them with confirmation from user:
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='sh'><span class='line'> find . -type f -name <span class="s2">&quot;*.bak&quot;</span> -exec rm -i <span class="o">{}</span> <span class="se">\;</span>
</span></code></pre></td></tr></table></div></figure>
</p>
<p>
Find all pdf files and copy them in DestinationFolder:
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='sh'><span class='line'> find . -type f -name <span class="s2">&quot;*.pdf&quot;</span> -exec cp <span class="o">{}</span> DestinationPath <span class="se">\;</span>
</span></code></pre></td></tr></table></div></figure>
</p>
<h2>Searching</h2>
<p> <br>
Search for pattern in files</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='sh'><span class='line'> grep pattern files
</span></code></pre></td></tr></table></div></figure>
<p>Search recursively for pattern in dir</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='sh'><span class='line'> grep -r pattern dir
</span></code></pre></td></tr></table></div></figure>
<p>Search for pattern in the output of command</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='sh'><span class='line'> <span class="nb">command</span> | grep pattern
</span></code></pre></td></tr></table></div></figure>
<p>Locate file – Find all instances of file <br>
Starting with the root directory, look for the file called filename</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='sh'><span class='line'> find / -name filename
</span></code></pre></td></tr></table></div></figure>
<p>Starting with the root directory, look for the file containing the string filename</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='sh'><span class='line'> find / -name ”*filename*”
</span></code></pre></td></tr></table></div></figure>
<p>Starting with the directory called dir, look for and list all files containing TextStringToFind</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='sh'><span class='line'> grep TextStringToFind /dir
</span></code></pre></td></tr></table></div></figure>
<p>Create symbolic link link to file</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='sh'><span class='line'> ln -s file link
</span></code></pre></td></tr></table></div></figure>
<p>Create or update file</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='sh'><span class='line'> touch file
</span></code></pre></td></tr></table></div></figure>
<p>Places standard input into file</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='sh'><span class='line'> cat &gt; file
</span></code></pre></td></tr></table></div></figure>
<p>Display the file called file one page at a time, proceed to next page using the spacebar</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='sh'><span class='line'> more file
</span></code></pre></td></tr></table></div></figure>
<p>Output the first 10 lines of file</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='sh'><span class='line'> head file
</span></code></pre></td></tr></table></div></figure>
<p>Display the first 20 lines of the file called file</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='sh'><span class='line'> head -20 file
</span></code></pre></td></tr></table></div></figure>
<p>Output the last 10 lines of file</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='sh'><span class='line'> tail file
</span></code></pre></td></tr></table></div></figure>
<p>Display the last 20 lines of the file called file</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='sh'><span class='line'> tail -20 file
</span></code></pre></td></tr></table></div></figure>
<p>Output the contents of file as it grows, starting with the last 10 lines</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='sh'><span class='line'> tail -f file
</span></code></pre></td></tr></table></div></figure>
<h2>Compression</h2>
<p> Compression</p>
<p> Create a tar named file.tar containing files</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='sh'><span class='line'> tar cf file.tar files
</span></code></pre></td></tr></table></div></figure>
<p>Extract the files from file.tar</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='sh'><span class='line'> tar xf file.tar
</span></code></pre></td></tr></table></div></figure>
<p>Create a tar with Gzip compression</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='sh'><span class='line'> tar czf file.tar.gz files
</span></code></pre></td></tr></table></div></figure>
<p>Extract a tar using Gzip</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='sh'><span class='line'> tar xzf file.tar.gz
</span></code></pre></td></tr></table></div></figure>
<p>Create a tar with Bzip2 compression</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='sh'><span class='line'> tar cjf file.tar.bz2
</span></code></pre></td></tr></table></div></figure>
<p>Extract a tar using Bzip2</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='sh'><span class='line'> tar xjf file.tar.bz2
</span></code></pre></td></tr></table></div></figure>
<p>Compresses file and renames it to file.gz</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='sh'><span class='line'> gzip file
</span></code></pre></td></tr></table></div></figure>
<p>Decompresses file.gz back to file</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='sh'><span class='line'> gzip -d file.gz
</span></code></pre></td></tr></table></div></figure>
]]></content>
</entry>

<entry>
<title type="html"><![CDATA[Control for <br> Interpolation - Extrapolation of points.]]></title>
<link href="http://marcocattai.github.io/blog/2008/09/10/control-for-interpolation-slash-extrapolation-of-points/"/>
Expand Down
4 changes: 4 additions & 0 deletions blog/2006/02/02/mpi-parallel-rotation/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,10 @@ <h1 class="entry-title">MPI - Parallel Rotation</h1>
<h2>recent posts</h2>
<ul class="recent_posts">

<li>
<a href="/blog/2011/06/10/linux-snippets/">Linux - snippets</a>
</li>

<li>
<a href="/blog/2008/09/10/control-for-interpolation-slash-extrapolation-of-points/">Control for <br> Interpolation - Extrapolation of points.</a>
</li>
Expand Down
4 changes: 4 additions & 0 deletions blog/2008/09/10/3d-graph-direct3d/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ <h1 class="entry-title">3D GRAPH - Direct3D</h1>
<h2>recent posts</h2>
<ul class="recent_posts">

<li>
<a href="/blog/2011/06/10/linux-snippets/">Linux - snippets</a>
</li>

<li>
<a href="/blog/2008/09/10/control-for-interpolation-slash-extrapolation-of-points/">Control for <br> Interpolation - Extrapolation of points.</a>
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ <h1 class="entry-title">Control for <br> Interpolation - Extrapolation of Points
<a class="pull-left" href="/blog/2008/09/10/3d-graph-direct3d/" title="Previous Post: 3D GRAPH - Direct3D">&laquo; 3D GRAPH - Direct3D</a>


<a class="pull-right" href="/blog/2011/06/10/linux-snippets/" title="Next Post: Linux - snippets">Linux - snippets &raquo;</a>

</footer>

</div>
Expand All @@ -214,6 +216,10 @@ <h1 class="entry-title">Control for <br> Interpolation - Extrapolation of Points
<h2>recent posts</h2>
<ul class="recent_posts">

<li>
<a href="/blog/2011/06/10/linux-snippets/">Linux - snippets</a>
</li>

<li>
<a href="/blog/2008/09/10/control-for-interpolation-slash-extrapolation-of-points/">Control for <br> Interpolation - Extrapolation of points.</a>
</li>
Expand Down
Loading

0 comments on commit 96b50b8

Please sign in to comment.