Searching for a specific phrase on Unix server


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Searching for a specific phrase on Unix server
# 1  
Old 02-07-2005
Searching for a specific phrase on Unix server

Is it possible to search all the file systems on a Unix server for a specific phrase?
# 2  
Old 02-07-2005
If you mean phrases inside files, something like

find / -type f | xargs grep "My phrase looks like this"

should do the job. If you're not sure of the case of your phrase, use grep -i.

If you're talking about the filenames themselves, standard find will do the trick

find / -name "*some_part_of_filename*" -type f

There is more than one way to do this, by the way Smilie

Cheers
ZB
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Homework & Coursework Questions

Accepting a phrase and counting the number of times that it is repeated in a specific website

1. The problem statement, all variables and given/known data: Develop a shell script that accepts a phrase and counts the number of times that it is repeated in a specific website. Note: Im not sure if it's the whole website, or just a specific page but im guessing its thewhole website. ... (2 Replies)
Discussion started by: Zakerii
2 Replies

2. Shell Programming and Scripting

How to find a phrase and pull all lines that follow until the phrase occurs again?

I want to burst a report by using the page number value in the report header. Each section starts with *PAGE NO:* 1 Each section might have several pages, but the next section always starts back at 1. So I want to find the "*PAGE NO:* 1" value and pull all lines that follow until "*PAGE NO:* 1"... (4 Replies)
Discussion started by: Scottie1954
4 Replies

3. UNIX for Dummies Questions & Answers

How to match on phrase at beginning of line and specific columns?

Here is my file: 700 7912345678910 61234567891234567891 700 8012345678910 61234567891234567891 I want to pull all lines that begin with '700' only if columns 11-12 are '79'. My code so far only pulls the '79', not the whole line: grep ^700 file1 | cut -c 11,12 |... (7 Replies)
Discussion started by: Scottie1954
7 Replies

4. Shell Programming and Scripting

Searching for a specific string in a file

Hi I am trying to search for a certain set of patterns within a file, and then perform other commands based on output. testfile contents: password requisite pam_cracklib.so lcredit=-1 ucredit=-1 ocredit=-1 script: D="dcredit=-1" if then echo $D exists else echo $D doesnt... (8 Replies)
Discussion started by: bludhemn
8 Replies

5. Shell Programming and Scripting

Searching for files with specific extensions

Hi, Could someone give me a hand with a search for files with two possible extensions, please. The requirement is simple - I need to issue a single ls command searching for files with the suffix of, say, *.txt and *.log. I've tried to use ls *.txt *.log which works if there are both... (4 Replies)
Discussion started by: neilmw
4 Replies

6. UNIX for Dummies Questions & Answers

Searching for specific filenames

Hi I would like to know how to search through a directory and pull out files that has a specific pattern in the filename. For example if the filename has "bsc" in it, then that file must be moved to another directory where I will perform some operations on it. I know grep can be used, but I'm... (17 Replies)
Discussion started by: ladyAnne
17 Replies

7. AIX

find the specific file in unix server

hello i need a help in finding a specific file where it is stored in the unix server. is there a way to find it. Regards (3 Replies)
Discussion started by: dsdev_123
3 Replies

8. Shell Programming and Scripting

grep - searching for a specific string

ppl, this is my "file" with fields orderno orderdate orderdesc telno street city 1 01/04/2006 abc 123 100 tampa 2 01/04/2006 abc 123 100 tampa 3 01/04/2006 abc 123 100 tampa 4 01/04/2006 abc ... (2 Replies)
Discussion started by: manthasirisha
2 Replies

9. UNIX for Dummies Questions & Answers

searching a file in a unix server

Please let me know which command and its format to use to search for a file. Windows provides a find option but i would like to know the equivalent in UNIX. for example i need to search for a file called uv.config and where exactly it is located in a unix server. TIA. (4 Replies)
Discussion started by: jhmr7
4 Replies

10. Shell Programming and Scripting

Searching for a specific string in an argumnet

I want to check the second argument for a specific string . The code below is what I am trying, but I get: UX:test (./test): ERROR: { if ($0 ~ /StringImLooking4/) {print $1} }: Unknown operator I want to test if the second argument contains the string StringImLooking4 Unixware 7 ... (1 Reply)
Discussion started by: dinplant
1 Replies
Login or Register to Ask a Question