most effective search ?

Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers most effective search ?
# 1  
Old 10-08-2002
most effective search ?

what's the most efficient and effective search for a file in a dir ?

I see many guys use this

# find - print

or something as such ? and sometimes pipe it to something else ?

Is there a better way of using "grep" in all of this ?

# 2  
Old 10-08-2002
It would probably be:
find . -print
which will tell you every file and directory in your current directory as well as each respective directories and subdirectories.

If you're looking for a specific name, you'd want something like:
find /path/to/whereever -name "*searchname*" -print
or better yet, use type to narrow it down to links, files, directories, etc...

Check the man page for your version of find to see lots of other options.
# 3  
Old 10-09-2002
Also, some platforms (I have only seen it on Linux) have the 'locate' command which can be less resource intensive.
# 4  
Old 10-09-2002
Also, in some OS's you will find the "which" command.
It searches for any kind of executables or files in the directories mentioned in the PATH & displays the absolute path of the file.

Usage :

#which "filename"
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Programming

About uncopyable class (on book:Effective C++)

See the following code: #include<iostream> using namespace std; class Uncopyable { protected: Uncopyable(){cout<<"hehe\n";} ~Uncopyable(){} private: Uncopyable(const Uncopyable &rhs){cout<<"oooops\n";}; Uncopyable& operator=(const Uncopyable &rhs); }; class Dog :... (5 Replies)
Discussion started by: vistastar
5 Replies

2. Cybersecurity

Password rules not effective

I was looking for a good list of words to exclude people from using as passwords, i.e. those that could be guessed easily. I'm working through a whole bunch of suggestions from, but I managed to find this page that seems to suggest I have more options than I thought. :b: I... (1 Reply)
Discussion started by: rbatte1
1 Replies

3. UNIX for Dummies Questions & Answers

[Solved] effective user id upon exec

Hello all. Despite the exec man page, the exec system call seems to turn my effective-user-id into my real-user-id. I coded and compiled 2 very simple c programs as user 1 (uid=501) The first one (A) prints real and effective user IDs and then execs the second one (B), which in turn prints... (7 Replies)
Discussion started by: oviv
7 Replies

4. UNIX for Dummies Questions & Answers

Real and Effective IDs

Can anyone explain me in details of Real and Effective IDs (6 Replies)
Discussion started by: kkalyan
6 Replies

5. Shell Programming and Scripting

what is the most effective way to process a large logfile?

I am dealing with a very large firewall logfile (more than 10G), the logfile like this *snip* Nov 9 10:12:01 testfirewall root: Nov 9 10:12:01 testfirewall root: 0:00:11 accept testfw01-hme0 >hme0 proto: icmp; src:; dst:; rule: 1; icmp-type: 8;... (8 Replies)
Discussion started by: fedora
8 Replies

6. UNIX for Dummies Questions & Answers

Changing the Effective Group ID

Here is my situation. On a RedHat 7.3 box, I have a user named jody. When I log in with jody and type in "id", I get the expected output: uid=1(jody) gid=1(jody) groups=1(jody), 510(test) However, I cannot figure which "id" option allows me to change the effective gid. I tried the options... (2 Replies)
Discussion started by: Jody
2 Replies

7. UNIX for Dummies Questions & Answers

Variables for Effective Username?

Hey all, I'm glad to have found this forum as I'm trying to dive head first into Solaris 8 - been working with it for a few months now and am finally getting a bit comfortable with the layout and concepts. In any case, on to the questions... :D I was wondering how I would go about displaying... (3 Replies)
Discussion started by: QuadMonk
3 Replies

8. Cybersecurity

Changing effective user

I would like to give execution rights for a script to one user. (that's the easy part...) When that user is running the script, I would like the effective user ID to be that of the file-owner. Is this possible? (6 Replies)
Discussion started by: hilmel
6 Replies
Login or Register to Ask a Question