nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

word search in directory

This is a discussion on word search in directory within the Coding in General forums, part of the Development/Scripting category; Hi, If i give a word from command line then it should give me the name of files which contain ...


Go Back   nixCraft Linux Forum > Development/Scripting > Coding in General

Register FAQ Members List Calendar Forgotten your password? Mark Forums Read
  #1 (permalink)  
Old 07-26-2008, 01:15 PM
Member
User
 
Join Date: Feb 2008
My distro: fedora
Posts: 30
Rep Power: 0
chandanperl is on a distinguished road
Default word search in directory

Hi,
If i give a word from command line then it should give me the name of files which contain that word. It should search a word within whole directory.

Thanks
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-27-2008, 12:15 PM
rockdalinux's Avatar
Contributors
User
 
Join Date: May 2005
Location: Bangalore
My distro: RHEL, HP-UX, Solaris, FreeBSD, Ubuntu
Posts: 581
Rep Power: 7
rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough
Default

Use grep command to search a word recursively in a current directory
Code:
grep -R 'word' *
__________________
Rocky Jr.
You may have my body & soul, but you will never touch my pride!

If you have knowledge, let others light their candles at it.

Certified to work on HP-UX / Sun Solaris / RedHat
Reply With Quote
Reply

Bookmarks

Tags
grep , shell


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

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 Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
word search in file chandanperl Coding in General 2 03-11-2008 11:16 AM
pattern search with numbers mercuryshipz Coding in General 0 02-15-2008 12:16 AM
find a word in a file, and change a word beneath it ?? vikas027 Shell scripting 2 02-14-2008 01:53 AM
Search Pattern And Arrays mercuryshipz Coding in General 1 02-11-2008 03:26 PM
user pass word sparky Shell scripting 1 06-26-2006 08:19 PM


All times are GMT +5.5. The time now is 01:58 AM.


Powered by vBulletin® Version 3.7.4 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36