Sponsored Content
Full Discussion: find & grep
Top Forums UNIX for Dummies Questions & Answers find & grep Post 990 by Neo on Wednesday 31st of January 2001 03:30:24 PM
Old 01-31-2001
Doing a find and then greping will certainly find the string within a string (in the file name) and works much better and faster. You are right PxT, this will not search the string within the file.

Code:
find / | grep lib

You will find a zillion occurances of the string 'lib' within a string. Here is a small sample and I've not even refined the grep or egrep (and just captured small output).

/usr/lib/gdk-pixbuf/loaders/libpixbufloader-png.so.1.0.0
/usr/lib/gdk-pixbuf/loaders/libpixbufloader-pnm.a
/usr/lib/gdk-pixbuf/loaders/libpixbufloader-pnm.la
/usr/lib/gdk-pixbuf/loaders/libpixbufloader-pnm.so.1.0.0
/usr/lib/gdk-pixbuf/loaders/libpixbufloader-ras.a
/usr/lib/gdk-pixbuf/loaders/libpixbufloader-ras.la
/usr/lib/gdk-pixbuf/loaders/libpixbufloader-ras.so.1.0.0
/usr/lib/gdk-pixbuf/loaders/libpixbufloader-tiff.a
/usr/lib/gdk-pixbuf/loaders/libpixbufloader-tiff.la
/usr/lib/gdk-pixbuf/loaders/libpixbufloader-tiff.so.1.0.0
/usr/lib/gdk-pixbuf/loaders/libpixbufloader-xpm.a
/usr/lib/gdk-pixbuf/loaders/libpixbufloader-xpm.la
/usr/lib/gdk-pixbuf/loaders/libpixbufloader-xpm.so.1.0.0
/usr/lib/gdk-pixbuf/loaders/libpixbufloader-bmp.so
/usr/lib/gdk-pixbuf/loaders/libpixbufloader-bmp.so.1
/usr/lib/gdk-pixbuf/loaders/libpixbufloader-gif.so
/usr/lib/gdk-pixbuf/loaders/libpixbufloader-gif.so.1

Yes, it does not search the actual file. I normally use PERL for that and not xargs. For some strange reason, xargs and I don't gel.... when I have to search files and strings within lots of files I use command line PERL.

[Edited by Neo on 01-31-2001 at 08:52 PM]
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

help with find & grep commands

Folks; First about find: when i run this: find . -name '*log*' -mtime +10 -print | sed 's+^\./++;s+/.*++' | sort -u i got list of log files but also get a directories (although directory names doesn't have "log" in it). How can i exclude the directory from the output of this find command? ... (2 Replies)
Discussion started by: moe2266
2 Replies

2. Shell Programming and Scripting

Find & Replace string in multiple files & folders using perl

find . -type f -name "*.sql" -print|xargs perl -i -pe 's/pattern/replaced/g' this is simple logic to find and replace in multiple files & folders Hope this helps. Thanks Zaheer (0 Replies)
Discussion started by: Zaheer.mic
0 Replies

3. UNIX for Dummies Questions & Answers

Difference between grep, egrep & grep -i

Hi All, Please i need to know the difference between grep, egrep & grep -i when used to serach through a file. My platform is SunOS 5.9 & i'm using the korn shell. Regards, - divroro12 - (2 Replies)
Discussion started by: divroro12
2 Replies

4. Shell Programming and Scripting

Find a string using grep & print the line above or below that.

Hi All, Please tell me how can I Find a string using grep & print the line above or below that in solaris? Please share as I am unable to use grep -A or grep -B as it is not working on Solaris. (10 Replies)
Discussion started by: Zaib
10 Replies

5. Shell Programming and Scripting

How to use grep & find command to find references to a particular file

Hi all , I'm new to unix I have a checked project , there exists a file called xxx.config . now my task is to find all the files in the checked out project which references to this xxx.config file. how do i use grep or find command . (2 Replies)
Discussion started by: Gangam
2 Replies

6. Shell Programming and Scripting

Using Grep & find & while read line in a script

Hello people! I would like to create one script following this stage I have one directory with 100 files File001 File002 ... File100 (This is the format of content of the 100 files) 2012/03/10 12:56:50:221875936 1292800448912 12345 0x00 0x04 0 then I have one... (0 Replies)
Discussion started by: Abv_mx81
0 Replies

7. UNIX for Dummies Questions & Answers

GREP Find & Replace <p class>

I am making an eBook. I am editing the html in BBedit. I need to replace all <p class="s5"> with just a <p>. How do I write this for GREP? Thank you, Abby (5 Replies)
Discussion started by: cuddlykitty
5 Replies

8. Shell Programming and Scripting

How do i find "&variable[0]" using grep -r?

Guys, i've got hundreds of C programs in my ~/devel/ directory and sub-directories. is there a way i can use grep -r followed by some zsh, sh, bash, to find some code that starts with "&foo" or something similar? thanks in advance! (9 Replies)
Discussion started by: Gary Kline
9 Replies

9. SCO

Grep to ignore suffix & find end of line

In COBOL, a hyphen can be used in a field name and in a specific program some field names would be identical to others except a suffix was added--sometimes a suffix to a suffix was used. For example, assume I am looking for AAA, AAA-BBB, and AAA-BBB-CCC and don't want to look at AAA-BBB-CCC... (7 Replies)
Discussion started by: wbport
7 Replies
gtk-query-immodules-2.0(1)					   User Commands					gtk-query-immodules-2.0(1)

NAME
gtk-query-immodules-2.0 - create a cache file used by GTK+ to efficiently locate input method modules SYNOPSIS
gtk-query-immodules-2.0 [immodule] [immodule...] DESCRIPTION
gtk-query-immodules-2.0 searches for input method (IM) modules for GTK+ and and writes information about them to stdout. If the output is redirected to /etc/gtk-2.0/gtk.immodules, then this will cause the GTK+ library to use these modules by default. This program is typically used by developers who are packaging GTK+ software which adds additional modules. IM modules can be selected by right-clicking on input fields when running GTK+ programs. An input method is a software component that con- verts key presses into text input that cannot be typed directly. Input methods are normally used to input text for languages that have more characters than can fit on a standard keyboard. Input methods are commonly used for Japanese, Chinese, and Korean text but are also used for other languages such as Thai and Hindi. If any modules are specified on the command line, gtk-query-immodules-2.0 only looks at those particular files. If no modules are specified on the command line, gtk-query-immodules-2.0 scans the user's GTK_PATH environment variable and looks at all IM modules that are specified there. When run, gtk-query-immodules-2.0 creates context information for each module. Each module has one or more contexts. If no IM modules are specified on the command line, the scanned paths are included as a comment in the output. OPTIONS
None. OPERANDS
The following operands are supported: immodule Specify the pathname to an IM module. This can be a full pathname, or relative to the current working directory. EXAMPLES
Example 1: Installing a new Input Method module myimmodule.so example% gtk_version=`pkg-config --variable=gtk_binary_version gtk-2.0` example% cp myimmodule.so /usr/lib/gtk-2.0/$gtk_version/immodules example% gtk-query-immodules-2.0 > /etc/gtk-2.0/gtk.immodules ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of gtk-query-immodules-2.0: GTK_PATH Specifies directories to prepend to the input method module path. GTK_IM_MODULE Specifies what IM modules to use, in preference to the IM module determined from the locale GTK_IM_MODULE_FILE Specifies the file that lists the IM modules to load. This environment variable overrides the im_module_file speci- fied in the RC files, which in turn overrides the default value in the system gtk.immodules file. EXIT STATUS
The following exit values are returned: 0 Application exited successfully >0 Application exited with failure FILES
The following files are used by this application: /usr/bin/gtk-query-immodules-2.0 The command-line executable for the application. /usr/lib/gtk-2.0/version/immodules Default location of IM modules. /etc/gtk-2.0/gtk.immodules The GTK+ input method modules file. /usr/share/gtk-doc/html/gtk Location of developer documentation ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWgnome-base-libs-devel | +-----------------------------+-----------------------------+ |Interface stability |Committed | +-----------------------------+-----------------------------+ SEE ALSO
gdk-pixbuf-csource(1), gdk-pixbuf-query-loaders(1), glib-genmarshal(1), glib-gettextize(1), glib-mkenums(1), gobject-query(1), gtk-update- icon-cache(1), libgtk-x11-2.0(3), attributes(5), environ(5), gnome-interfaces(5) NOTES
Written by Brian Cameron, Sun Microsystems Inc., 2003, 2006, 2007. SunOS 5.11 21 Oct 2007 gtk-query-immodules-2.0(1)
All times are GMT -4. The time now is 01:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy