Go Back  DVD Talk Forum > General Discussions > Tech Talk
Reload this Page >

Anybody know UNIX?

Tech Talk Discuss PC Hardware, Software, Internet and Other Technology

Anybody know UNIX?

Old 09-26-01, 10:43 AM
  #1  
DVD Talk Special Edition
Thread Starter
 
Join Date: Feb 2001
Location: Brampton, Ontario, Canada
Posts: 1,611
Likes: 0
Received 0 Likes on 0 Posts
Anybody know UNIX?

I need to know the command to search within files for a certain string.

My psudeo code:

find . find any file that has foo in it -show them to me

Thanks.

Last edited by RaptorsFan; 09-26-01 at 10:45 AM.
Old 09-26-01, 12:38 PM
  #2  
X
Administrator
 
X's Avatar
 
Join Date: Oct 1987
Location: AA-
Posts: 10,763
Likes: 0
Received 4 Likes on 3 Posts
Re: Anybody know UNIX?

Originally posted by RaptorsFan

find . find any file that has foo in it -show them to me
grep foo *
Old 09-26-01, 02:22 PM
  #3  
DVD Talk Special Edition
Thread Starter
 
Join Date: Feb 2001
Location: Brampton, Ontario, Canada
Posts: 1,611
Likes: 0
Received 0 Likes on 0 Posts
Thanks for the help X. This is what I get:

# grep allinson *
grep: can't open rprt

I am using root when I run this. And it takes almost no time to comeback.

Am I missing something?
Old 09-26-01, 02:40 PM
  #4  
X
Administrator
 
X's Avatar
 
Join Date: Oct 1987
Location: AA-
Posts: 10,763
Likes: 0
Received 4 Likes on 3 Posts
Is rprt a file that you don't have rights to? You might have to get more explicit in the filenames.
Old 09-26-01, 04:05 PM
  #5  
Senior Member
 
Join Date: May 2000
Location: Seattle, drizzle and grey
Posts: 466
Likes: 0
Received 0 Likes on 0 Posts
You may also want to try using some options to the grep command.

Try:

grep -ins allinson *


the options are as follows:

i - ignore case

n - line number in the fiels where found

s - do not report errors on files that are nonexistant or unreadable
Old 09-27-01, 10:05 AM
  #6  
DVD Talk Special Edition
Thread Starter
 
Join Date: Feb 2001
Location: Brampton, Ontario, Canada
Posts: 1,611
Likes: 0
Received 0 Likes on 0 Posts
Thanks everybody!!!!!!!

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Thread Tools
Search this Thread

Archive - Advertising - Cookie Policy - Privacy Statement - Terms of Service - Do Not Sell My Personal Information

Copyright 2018 MH Sub I, LLC dba Internet Brands. All rights reserved. Use of this site indicates your consent to the Terms of Use.