Equivalent to locate


 
Thread Tools Search this Thread
Operating Systems Solaris Equivalent to locate
# 1  
Old 09-26-2006
Equivalent to locate

Does Solaris 10 have an equivalent to FreeBSD's `locate'?

If not, what is the best way to search for files (allowing regexp) throughout the system?
# 2  
Old 09-26-2006
Looks like that is a command specific to FreeBSD - you can use one of the following as replacements.

find
which
whereis
# 3  
Old 09-26-2006
I think that's not only a FreeBSD command, as far as I know, it's part of GNU Findutils. It's also available in most Linux dists. You can download a solaris binary version from sunfreeware.
The main difference between find/which/whereis and locate is how it works. Basically, locate uses a database previously generated by the user or a cron job with the command "updatedb".
Regards.
# 4  
Old 10-05-2006
A pretty good way of doing find is by actually disabling it! hear me out.

Only allow root to use it. Take a full listing of the entire server and stick it into a file. And do this once per week, stick it in cron. That way you only have 'find' run once a week. All users of the system can then search through the file for the find, they can simply grep it out. It is MUCH better on the system. 'find' is resource intensive. Your system will run much smoother if you know you have a lot of users constantly looking for files.

If once a week aint good enough, try it twice accordingly to your environment.

-Sowser
# 5  
Old 10-05-2006
In that case why not just grep /var/sadm/install/contents?
# 6  
Old 10-05-2006
thats a good idea too...but i am not answering the question really.

I am just giving some extra info. Sometimes, you are not just looking for commands. You are looking for a file.

ex.
if you have a server with over 2 million files that are unique, then you can just pump that listing to a file and search that 1 file.

but your right, you can check the install directory for system commands.

-Sowser
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

HELP! I want to locate only dir and tar.gz

I making a script to restore apache from a configuration_backup tar. For now i want at the beginning of the script that you can make a choice to choose one of the configuration_backup tars. I use this code now: `locate /restore/configuration/configuration_backup*` But if i use this i get... (1 Reply)
Discussion started by: dannyvdberg
1 Replies

2. UNIX for Advanced & Expert Users

Tring to locate a script

Hello, We have a process on our Linux RedHat machine creating symbolic links and moving around some files from domain to domain. The issue is that the programmer has left a long time ago and nobody knows how the program is called, where it is and how the scheduling is setup. It runs every day for... (7 Replies)
Discussion started by: Indalecio
7 Replies

3. Red Hat

Can't locate DBI.pm in @INC

my os details as follow bash-3.2$ cat /etc/redhat-release Red Hat Enterprise Linux Server release 5.8 (Tikanga) I run the following and encounter the following error bash-3.2$ mysqlhotcopy -? Can't locate DBI.pm in @INC (@INC contains:... (5 Replies)
Discussion started by: jediwannabe
5 Replies

4. UNIX for Dummies Questions & Answers

Locate equivalent in UNIX

Hi All, I am a frequent user of loacate in linux and really impressed with its speed and accuracy. I would like to know if there is any such equivalent in UNIX. (not the find, which is relatively very slow) Any locate packages which can be made available in UNIX(HP-UX) for this? TIA,... (4 Replies)
Discussion started by: pradebban
4 Replies

5. UNIX for Dummies Questions & Answers

Usage of locate

Hi The locate command searches the pattern in all the directories. How can i make it look in for a specific directory because i know the directory in which the file exists. Thanks (1 Reply)
Discussion started by: 2002anand
1 Replies

6. AIX

Locate command

Hello to all, Can I use the "locate" command on AIX 5.3 like on Linux. If yes what packages should I install and where can I find them. Thanks, Enid (9 Replies)
Discussion started by: enux
9 Replies

7. Linux

Help to locate the files

I m new to the linux environment.Help me with ur suggestions. How can i obtain the file names alone from ls -ltr output?? And those files should have been created before three months and earlier than that.. Thanks and wishes, Rupaa. (8 Replies)
Discussion started by: Rupaa
8 Replies

8. UNIX for Dummies Questions & Answers

command locate.

Hi, I am aware of the command locate/slocate. But when I try to search the file which is located in /tmp. Its not able to get it. I tried by updating the database also with the command updatedb. Is there any consern that the command 'locate' dont check /tmp??? And I knew that locate is the... (5 Replies)
Discussion started by: praveen_b744
5 Replies

9. Shell Programming and Scripting

script to locate servers

I am a newbie in shell scripting and I need to produce a script to work and achieve the following: 1) Look into the file /etc/defaultrouter , and store the value in it 2) If the value is a number, go to LIST and print out the second column corresponding to the value.(eg London) 3) If the... (5 Replies)
Discussion started by: ibroxy
5 Replies

10. UNIX for Dummies Questions & Answers

not able to locate SSH

In our unix environment I'm not able to locate where ssh is located. can any one guide me in finding the location of this tool. (5 Replies)
Discussion started by: bishweshwar
5 Replies
Login or Register to Ask a Question