09-18-2001
I have used before a quick little hack in places that I could not install the "slocate" package. I run a job from cron similar to the following:
find / -type f -print >/root/etc/list.files 2>/dev/null
Then I wrote a simple finder script that searches through the list for the files - it's a LOT faster than waiting for find to complete! Plus, with a little fancy scripting (guffaw), you can search for items only in "bin" directories, or in your $PATH, incase you think you know the name of a program, but forgot exactly what it is.
I now think that slocate is a better idea, since it "remembers" permissions - so if you can't view it anyway, it won't show up.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
given a start directory,a filename,how to find it? (3 Replies)
Discussion started by: bluo
3 Replies
2. UNIX for Advanced & Expert Users
how can i get the find command to display the filename without the path.
example:
find /tmp/test
/tmp/test1
/tmp/test2
/tmp/test3
should return
test1
test2
test3
i'm using bash.
also, whats the best way to ignore the . and .. directories? (5 Replies)
Discussion started by: kuliksco
5 Replies
3. UNIX for Dummies Questions & Answers
I need to find whether there is a file named vijay is there or not in folder named "opt" .I tried "ls *|grep vijay" but it showed permission problem.
so i need to use find command (6 Replies)
Discussion started by: amirthraj_12
6 Replies
4. Shell Programming and Scripting
Im trying to make a very simple find the first file with the .zip extension in a specific folder and open that file.
The folder path and file name will vary every-time and it may contain spaces. If I try to look
For this example the folder directory is /Users/username/Desktop/testfolder/abc... (6 Replies)
Discussion started by: elbombillo
6 Replies
5. Linux
Hi,
I'm using the following command to find the multiple requierd file types and its working fine
find . -name "*.pl" -o -name "*.pm" -o -name "*.sql" -o -name "*.so" -o -name "*.sh" -o -name "*.java" -o -name "*.class" -o -name "*.jar" -o -name "*.gz" -o -name "*.Z" -type f
Though... (2 Replies)
Discussion started by: vickramshetty
2 Replies
6. Shell Programming and Scripting
Hi all ,
I'm new to unix
I have a checked project , there exists a file called xxx.config .
now my task is to find all the files in the checked out project which references to this xxx.config file.
how do i use grep or find command . (2 Replies)
Discussion started by: Gangam
2 Replies
7. Shell Programming and Scripting
Hi,
I want find multiple string in one file using find coomand.
And keeping it in one variable.grep is not working. (5 Replies)
Discussion started by: vivek1489
5 Replies
8. Shell Programming and Scripting
Hi,
As a newbie, I'm desperate ro make my shell script work. I'd like a script which checks all the files in a directory, check the file name, if the file name ends with "extracted", store it in a variable, if it has a suffix of ".roi" stores in another variable. I'm going to use these two... (3 Replies)
Discussion started by: armando110
3 Replies
9. Shell Programming and Scripting
find . -type fl
o/p is only the ordinary file. where in it wont give the link files. (2 Replies)
Discussion started by: nikhil jain
2 Replies
10. Shell Programming and Scripting
Hello guys, im new to to unix/linux
i have a text file like this:
person1@test.com iisiiasasas
person2@test.com 123w2 3233
sajsja person3@test.com jsajjsa
sajsjasaj person4@test.com
I want to extract only e-mail address and get rid of all other stuff, i want an output like this
... (4 Replies)
Discussion started by: RazorMX
4 Replies
LEARN ABOUT OPENSOLARIS
slocate
SLOCATE(1) General Commands Manual SLOCATE(1)
NAME
slocate - Security Enhanced version of the GNU Locate
SYNOPSIS
slocate [-qi] [-d <path>] [--database=<path>] <search string>
slocate [-i] [-r <regexp>] [--regexp=<regexp>]
slocate [-qv] [-o <file>] [--output=<file>] slocate [-e <dir1,dir2,...>] [-f <fstype1,...>] <[-l <level>] [-c] <[-U <path>] [-u]>
slocate [-Vh] [--version] [--help]
DESCRIPTION
Secure Locate provides a secure way to index and quickly search for all files on your system regardless of ownership. It uses incremental
encoding just like GNU locate to compress its database to make searching faster, but it will also check file permissions and ownership
before displaying matched entries so that users will not see files they do not have access to. Note that permissions and ownership are not
stored in the database.
This manual page documents slocate. slocate Enables system users to search entire filesystems without displaying unauthorized files.
OPTIONS
-u Create slocate database starting at path /.
-U <dir>
Create slocate database starting at path <dir>.
-e <dir1,dir2,...>
Exclude directories from the slocate database.
-f <fstype1,...>
Exclude files on specific file systems from the slocate database.
-c Parse '/etc/updatedb.conf' when updating the slocate database. (see CONFIGURATION FILE below).
-l <level>
Security level. 0 turns security checks off. This will make searchs faster. 1 turns security checks on. This is the default.
-i Does a case insensitive search.
-q Quiet mode. Error messages are suppressed.
-n <num>
Limit the amount of results shown to <num>.
-r <regexp>
--regexp=<regexp> Search the database using a basic POSIX regular expression.
-o <file>
--output=<file> Specfies the database to create.
-d <path>
--database=<path> Specfies the path of databases to search in.
-h --help Display this help.
-v --verbose Verbose mode. Display files when creating database.
-V --version Display version.
ENVIRONMENT
LOCATE_PATH
Colon-separated list of databases to search.
CONFIGURATION FILE
Secure Locate will parse GNU Locate's /etc/updatedb.conf when the argument is provided. But please be aware that Secure Locate currently
does NOT support all options provided by GNU Locate's configuration file.
Options currently supported by Secure Locate are PRUNEFS and PRUNEPATHS
VERSION
Secure Locate v3.0 beta
AUTHOR
Kevin Lindsay - Copyright (c) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
BUG REPORT
Report bugs to slocate@trakker.ca
URL
http://slocate.trakker.ca/
SEE ALSO
updatedb(1)
January 6, 2006 SLOCATE(1)