LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 06-17-2004, 06:07 AM   #1
Mr T Donegal
Member
 
Registered: Feb 2004
Location: Netherlands
Distribution: Suse 9.3
Posts: 31

Rep: Reputation: 15
Locating Installed Programs /or Files


I sometimes have problems locating programs installed using (configure, make, make install). I was hoping that someone could help me regarding the two linux search features 'find' and 'locate'...

Using locate: I can usually locate a newly installed program by using 'locate' (e.g. 'locate fotoon' - where fotoon is a newly installed program). However, I must first run 'updatedb' (update the 'locate' databse). This takes literally 10 minutes and uses up a lot of the computer's resources because 'updatedb' searches all (3) of my hard drives. So my first question is: is there a way of limiting updatedb to only a single hard drive or location.

The second question is related to the command 'find' - I've never been able to find anything very important with it! I presume this is because I am searching in the current directory. I would like to be able to search in a directory and all it's sub-directories (typically a program might be installed somewhere below '/usr'/). I tried a few things (including reading the 'man' page for find), but I cannot get it to work so I must be missing something obvious.

I have an additional problem with graphical KDE find program 'kfind'. The problem is that it crashes a lot. Typically it doesn't crash when trying to find a file in one directory, but does crash when trying to find a file with the 'include sub-directories' tree is ticked (so it's not much use like this - using the konqueror file exporer is much easier for finding a file in a directory). I'm using Mandrake 10.0 installed without much problems on AMD 1400 Mhz computer.

Many thanks for any help with these issues.
 
Old 06-17-2004, 06:53 AM   #2
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
Most programs are installed into the /usr directory. After running 'make install', run the command
find /usr -cmin -10
This will locate all files in the usr directory created in the last 10 minutes.
 
Old 06-21-2004, 09:03 AM   #3
geokker
Member
 
Registered: Jun 2004
Distribution: Ubuntu 6.10 Edgy Eft
Posts: 60

Rep: Reputation: 15
jschiwal, if you need any babies, I'm your man!

I keep wanting to decipher the myriad switches in the 'find' command but make excuses and forget about it. You've stoked the fire now you top man you!
 
Old 06-21-2004, 12:27 PM   #4
hcgernhardt
LQ Newbie
 
Registered: Apr 2004
Distribution: Slackware
Posts: 29

Rep: Reputation: 15
Try this from your shell prompt:
Code:
cd /
find . -depth -name <whatever.your.file.name.is.for.which.you.are.searching>
This will traverse the entire directory structure, and will probably take as long if not longer than using locate.

here's my suggestion for installing/uninstalling. If you have a standard source package that uses the ./configure && make && make install process, it most likely has a rule called uninstall. Once you have run make install, pack your source tree, e.g: (please note, $ indicates the prompt, and anything on the line after the $ is what you type)
Code:
$ls -p
my-source.1.1.0/
$tar -cf my-source.1.1.0.local.install.tar my-source.1.1.0/
$ls -p
my-source.1.1.0/    my-source.1.1.0.local.install.tar
$gzip my-source.1.1.0.local.install.tar
$ls -p
my-source.1.1.0/    my-source.1.1.0.local.install.tar.gz
$rm -rf my-source.1.1.0
$ls -p
my-source.1.1.0.local.install.tar.gz
Please note that the ls's are used to show you what you have in your directory. After performing the tar and gzip commands, you now have a tarball which contains everything which was used to create the binaries and installation---the sources, configuration scripts, object files, etc. Optionally, you could make clean prior to creating the tarball, which would remove the object files and (I believe) leave the configuration files intact.

Now you have your original source tree archived, and should you ever need to remove the program, all you need to do is:
Code:
$tar -zxvf my-source.1.1.0.local.install.tar.gz
$cd my-source.1.1.0
$make uninstall
...various output here...
$cd ..
$rm -rf my-source.1.1.0
This, of course, assumes that the now seemingly standard process of ./configure && make && make install exists, an that the developers who created the package wrote an uninstall rule into the makefile.

Of course, you could always perform the installation script, redirect the output to a file, then grep the file to find where it has placed everything, and proceed to write a quick uninstall script.

Hope it helps,

Henry
 
Old 06-28-2004, 08:19 PM   #5
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
The find command is one that is so useful, that it is worth the time to learn more of the options. Just use the man page when you want to use it and concentrate on one of the options at a time until you can remember a half dozen without resorting to the manpage. You may never need to use all of the options. Many of the options on unix commands come into use more often when writing scripts

It is the Unix philosophy use write programs by utilizing power-tools like find, sed, awk, working together. A GUI program you use may actually run these utilities in the background. That is why there are so damn many confusing options. It is best just to learn the most often used options so that you are very confortable with them and to refer to the man page when you need to fine-tune a script.

I have one other tip. Try entering man:find in the konqueror web-browser, of the application launcher. This will give you a web page man page, which uses a kde modified version of the man2html program. I find this format a lot easier to read and remember.
 
Old 06-28-2004, 08:36 PM   #6
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
Another related thought. While most tarball installations use /usr as the base installation dir, changing it to /usr/local may be a good habit to get into. The /usr/local contents will not be touched when upgrading your distribution. You could even mount a seperate partition for the /usr/local mountpoint. This would allow you to simply not format it in the event you perform a new installation of another distro for example.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Wine problem - missing files when running not installed programs TMH2 Linux - Software 2 06-28-2005 03:35 PM
Linux Programs and Files: accessible by any installed distro? hanzj Linux - Newbie 10 04-19-2005 06:46 AM
Locating GTK files so that I can compile a program Bob Moore Linux - General 0 06-24-2004 09:03 AM
Help Needed Locating a RPM Installed Program. phiqtion Linux - Software 2 09-20-2003 07:49 AM
where is the location of installed programs? in windows there is progam files.. hmm kublador Linux - Newbie 7 03-15-2003 03:09 AM


All times are GMT -5. The time now is 07:19 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration