Default diff on linux?

Additional operating system/hardware discussion (Windows, Linux, *BSD and others)
Forum rules
Any posts concerning pirated software or offering to buy/sell/trade commercial software are subject to removal.
User avatar
mnorton
Posts: 223
Joined: Tue May 17, 2005 11:36 am
Location: Caulifawnia

Default diff on linux?

Unread postby mnorton » Thu Aug 23, 2012 12:08 pm

hi,

I have multiple copies of diff installed on my ubuntu. How do I tell which one is the default?
Somehow I have multiple installs of a couple of utilities I want to track down and weed out.

thanks.
Image x1 Image x2

User avatar
porter
Posts: 2917
Joined: Wed Nov 01, 2006 10:37 pm
Location: NZ

Re: Default diff on linux?

Unread postby porter » Thu Aug 23, 2012 10:04 pm

Have you diff on them to find the difference between them?

I imagine you can't have more than one diff in /usr/bin

Are you refering to which package does it belong to? So you have multple packages claiming ownership of the same file? If that is the case I assume you are left with the one from the latest package to install.

This URLmight help. http://lists.netisland.net/archives/plu ... 00205.html
Land of the Long White Cloud and no Software Patents.

User avatar
mnorton
Posts: 223
Joined: Tue May 17, 2005 11:36 am
Location: Caulifawnia

Re: Default diff on linux?

Unread postby mnorton » Thu Aug 23, 2012 10:09 pm

Is there a way to tell which one is the default utility? (i.e. which one the system executes?)


thanks
Image x1 Image x2

User avatar
porter
Posts: 2917
Joined: Wed Nov 01, 2006 10:37 pm
Location: NZ

Re: Default diff on linux?

Unread postby porter » Thu Aug 23, 2012 10:18 pm

Code: Select all

which


as in

Code: Select all

which diff
Land of the Long White Cloud and no Software Patents.

User avatar
kjaer
Posts: 351
Joined: Wed May 07, 2008 7:47 pm
Location: Seattle, WA
Contact:

Re: Default diff on linux?

Unread postby kjaer » Fri Aug 24, 2012 3:27 pm

don't use 'which'. 'which' is a BS linuxism and a csh built-in everywhere else. on solaris calling 'which' from a bourne shell runs a script that starts with

Code: Select all

#!/usr/bin/csh
, and is almost never what you actually want (because it sources .cshrc, and a long list of other reasons).

bourne shell uses 'type'. it's a built-in, and does what you want. unless you're actually already running csh. then carry on with 'which'.

Code: Select all

$ type diff
diff is /usr/bin/diff
$ type type
type is a shell builtin
$ type vi
vi is aliased to `vim'
:OnyxR: :IRIS3130: :IRIS2400: :Onyx: :ChallengeL: :4D220VGX: :Indigo: :Octane: :Cube: :Indigo2IMP: :Indigo2: :Indy:


Return to “Miscellaneous Operating Systems/Hardware”

Who is online

Users browsing this forum: No registered users and 1 guest