Saari Development

Ali Rizvi's Technical Blog as a Professional Software Development Engineer

Archive for the ‘linux/unix’ Category

*nix: Comparing two files

with one comment

Everybody knows about diff.

I read about sdiff today for side by side diff.

Here is the one I found useful in some cases but I forget it so I am saving it here:

NAME
cmp – compare two files

SYNOPSIS
cmp [-l | -s] file1 file2 [skip1 [skip2]]

DESCRIPTION
The cmp utility compares two files of any type and writes the results to
the standard output. By default, cmp is silent if the files are the
same; if they differ, the byte and line number at which the first differ-
ence occurred is reported.

May be I will add some examples to show the difference but later.

Advertisements

Written by imsaar

February 23, 2009 at 10:18 pm

Posted in linux/unix

*nix: nslookup to resolve an IP to host name

leave a comment »

nslookup is useful to resolve an ip address to a host name in the linux/unix environment.

nslookup – query Internet name servers interactively

Written by imsaar

September 13, 2007 at 12:27 am

Posted in linux/unix

Ruby : Where are the gems on ubuntu 7.04

leave a comment »

It took me some time to figure it out where the gems are installed on my ubuntu 7.04 linux machine so I thought I would save it here as a reminder. The ruby gems are stored here:

/var/lib/gems/1.8/gems

What I did to find this is to run gem install without sudo to see the error message:


me@desktop:/usr/lib/ruby/1.8$ gem install rails
Bulk updating Gem source index for: http://gems.rubyforge.org
ERROR: While executing gem ... (Errno::EACCES)
Permission denied - /var/lib/gems/1.8/cache/rails-1.2.3.gem

The permission denied message gave me my answer. Who said error messages are not educational?

Hurray!

Written by imsaar

August 8, 2007 at 2:15 pm

Posted in linux/unix, ruby