meld – cvs diff with ease

2012-10-17 1 min read Fedora
Visualization of the “history tree” of a revision controlled project, showing branching, merging, tagging, etc. (Photo credit: Wikipedia) There are couple of ways to make life easier with CVS diff. But here is one that is really good. First if you haven’t, install meld: sudo yum install meld meld is basically a diff viewer and pretty good at it 😉 Now open meld from the menu or from the terminal. And then select New. Continue reading

Compare files excluding certain lines.

2011-10-18 1 min read bash Fedora Learning Linux
Quick tip, you can use any expression for the sed commands in the (). With this trick you can redirect the stdout of 2 commands to the diff command. This might become very useful, if you want to compare 2 files, excluding the first line. diff <(sed '1d' file) <(sed '1d' file2) More interesting example is where the string ABC is converted to abc before comparing in the second file with the following command: Continue reading

Find out why a program can't seem to access to a file

2010-05-05 2 min read Fedora Linux
$ strace php tias.php -e open,access 2>&1 | <a class="zem_slink freebase/en/grep" href="http://en.wikipedia.org/wiki/Grep" title="Grep" rel="wikipedia">grep foo.txt Sometimes a program refuses to read a file and you&#8217;re not sure why. You may have display_errors turned off for <a class="zem_slink freebase/en/php" href="http://www.php.net/" title="PHP" rel="homepage">PHP or something. In this example, fopen(&#8217;/var/www/test/foo.txt&#8217;) was called but doesn&#8217;t have read access to foo.txt. Strace can tell you what went wrong. E.g., if php doesn&#8217;t have read access to the file, strace will say &#8221;EACCESS (Permission denied)&#8221;. Continue reading

Diff Linux command — Find the difference in files the easier way.

2009-09-17 2 min read Linux
In Linux you can use diff command to find the differences in file. What is interesting is that you can use &#8221;diff -u&#8221; to list the differences with &#8217;+&#8217; and &#8217;-&#8217; rather than sometimes confusing &#8217;>&#8217; and '<&#8217;. An interesting article on finding the difference in files can be read <a href="http://docs.hp.com/en/5971-3502/5971-3502.pdf">here. For reference:<h3 class="post-title entry-title"> <a set="yes" linkindex="1" href="http://amjith.blogspot.com/2007/07/visual-diff-tools-in-linux.html">Visual Diff Tools in Linux <div class="post-body entry-content"> <div style="text-align: center;">*\*This is a not a post about how to use diff and patch commands. Continue reading