whats command for search including sub directory ?


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users whats command for search including sub directory ?
# 1  
Old 02-29-2008
whats command for search including sub directory ?

What is the command for search the program name from the entire directory (all directories in the unix box, means including sub directories...)
# 2  
Old 02-29-2008
what i do is:
ls -R > allfiles
it stores all filenames in directory wise in a file; named allfiles.
then
grep myfile from allfiles.
this is the fastest way that i know if you have to search for files often.
# 3  
Old 03-01-2008
Try find command
eg.
find / -print |grep -i programname
or
find / -type f -name programname

man find to get more option...

-timontt
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Change to directory and search some file in that directory in single command

I am trying to do the following task : export ENV=aaa export ENV_PATH=$(cd /apps | ls | grep $ENV) However, it's not working. What's the way to change to directory and search some file in that directory in single command Please help. (2 Replies)
Discussion started by: saurau
2 Replies

2. Shell Programming and Scripting

Find command to search files in a directory excluding subdirectories

Hi Forum, I am using the below command to find files older than x days in a directory excluding subdirectories. From the previous forums I got to know that prune command helps us not to descend in subdirectories. Though I am using it here, not getting the desired result. cd $dir... (8 Replies)
Discussion started by: jhilmil
8 Replies

3. Shell Programming and Scripting

Find file and zip without including directory path

Does anyone know of a way to zip the resulting file from a find command? My approach below finds the file and zips the entire directory path, which is not what I need. After scanning the web, it seems to be much easier to perform gzip, but unfortunately the approach must use zip. find `$DIR`... (5 Replies)
Discussion started by: koeji
5 Replies

4. Shell Programming and Scripting

Search for Pattern and Print including Lines in between

Gurus, I have a big file that needs to be sorted out and I cant figure out what to do. The file name is as below: Name: xxxx yyyy nnnn Description: dfffgs sdgsgsf hsfhhs afgghhjdgj fjklllll gsfhfh Updated: jafgadsgg gsg Corrected: date today The file consists of line like these. ... (13 Replies)
Discussion started by: The One
13 Replies

5. AIX

how to find whats filling up Root Directory

Hi guys I am running AIX 5.3 and a newbie to it. And I am getting reports telling me that the Root Directory is reaching almost max capacity, can someone give m some advice to find out what files are causing it to grow? , or how I can identify the growing files? Thanks (6 Replies)
Discussion started by: ryanbsc@gmail.c
6 Replies

6. Linux

Whats for: /etc/locks directory?

Hi there! Can someone please tell me what is for the directory /etc/locks and provide me with an example. I certainly don't understand it very well. Any help will be much appreciated! (1 Reply)
Discussion started by: agasamapetilon
1 Replies

7. UNIX for Dummies Questions & Answers

Unix find command to print directory and search string

Hi i need to print pathname in which the string present using 'find' command sample output like this Pathname String to be searched ---------- -------------------- /usr/test/myfile get /opt/test/somefile get Thanks in... (4 Replies)
Discussion started by: princein
4 Replies

8. Shell Programming and Scripting

search in a directory using grep command

Hi, I want to search files/directories in /temp directory which starts with letter 'a'. How can I do that using grep command. I can find out like ls -ltr a* but I want to use grep command like ls -ltr | grep ..... like that. Please help. Malay (4 Replies)
Discussion started by: malaymaru
4 Replies

9. UNIX for Dummies Questions & Answers

find directory not including current

Using Solaris 8, I've forgotten how to exclude the current directory in the find results. find . -type d ! -name "*.CAP" I want every directory that does not match the *.CAP pattern, except the current directory. (2 Replies)
Discussion started by: dangral
2 Replies

10. Solaris

Whats the command to see

What fonts are installed on a Solaris 8? I have no GUI so a command line command would be great. Thank you (2 Replies)
Discussion started by: Acleoma
2 Replies
Login or Register to Ask a Question