Linux / UNIX Tech Support Forum
This is a discussion on script to search a "sentence" on a group of files. within the Shell scripting forums, part of the Development/Scripting category; Hello, i would like to search the sentence "localhost.localdomain" on all my config files, I know that 'find' can do ...
|
|||||||
| Shell scripting You can discuss the shell scripting, request shell scripts and scripting techniques |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
| Sponsored Links | ||
|
|
|
||||
|
Search in a current directory
Code:
grep "localhost.localdomain" * grep "localhost.localdomain" *.conf Code:
grep -w "localhost.localdomain" * grep -w "localhost.localdomain" *.conf Code:
grep -i -w "localhost.localdomain" * grep -i "localhost.localdomain" *.conf Code:
grep -i -w -r "localhost.localdomain" *
__________________
Vivek Gite Linux Evangelist |
|
||||
|
What I have done:
Code:
find . -exec grep "localhost.localdomain" '{}' \; -print
Last edited by permalac; 04-09-2008 at 02:47 PM. |
![]() |
| Tags |
| find , finding file , grep , linux , unix |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Subtraction of float-numbers using only bash(without "bc") | Lovingod | Shell scripting | 2 | 04-09-2008 01:10 AM |
| Redhat: Up2date " permission denied" while root | guarrand | Getting started tutorials | 2 | 03-07-2008 11:50 AM |
| Does Redhat have "what" utility which can be used to display identification Info? | DCAO | Linux software | 2 | 30-10-2007 07:23 PM |
| [Commercial] SafeSquid "SPEED-BOOSTER" 4.2.0 Released | httpproxy | Networking, Firewalls and Security | 1 | 26-09-2007 08:05 PM |
| "permission denied" - Installing Lighttpd on RHEL 4 | b3n | Web servers | 3 | 29-08-2007 07:45 PM |