Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Find in file. Does this exist under UNIX? Post 96310 by scampsd on Thursday 19th of January 2006 08:52:33 AM
Old 01-19-2006
Find in file. Does this exist under UNIX?

Hello,
I have the following problem. I know there is a file somewhere on a UNIX machine that contains a string, but I don't know where.

With the "grep" command, I can look into a file but only if I'm located in the correct directory.

With the "find" command, I can search across directories but I cannot specify to search within the files for a certain string.

Does there exist a standard UNIX command for looking for a text within a file without knowing the directory in which the file is located?

Thanks
Dominique
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Can Unix Co-Exist with Windows 9X on the same System?

Is it possible to install unix on a system which already runs windows 98? (2 Replies)
Discussion started by: ms73eb
2 Replies

2. Shell Programming and Scripting

how to find a file in UNIX without find command?

given a start directory,a filename,how to find it? (3 Replies)
Discussion started by: bluo
3 Replies

3. UNIX for Advanced & Expert Users

Does UNIX-Chmod in windows exist?

Is there an command in windows to chmod a file to 666 so that when I mount a NAS on solaris, the user can read/write/remove the file from unix server? Traditionally, we invoke ftp from unix to windows, get the file and remove it. With a NAS, can windows chmod the file 666 so that unix can edit... (2 Replies)
Discussion started by: izy100
2 Replies

4. Shell Programming and Scripting

Can I find wether a particular file exist and size greater than zero...help please

Can I find wether a particular file exist and size greater than zero in one line command. similar to this if && something in one if test .... e.g. if 1.) is it possible ? ... if yes how 2.) what would be the return type in case there is success or failure. I mean if both are... (4 Replies)
Discussion started by: guhas
4 Replies

5. UNIX for Dummies Questions & Answers

How to find if file exist in directory using *

Hi, I know how to use the test command ( ...) to find a single given name file. However, I have a case in which I have a directory with one file and one sub-directory. I know that the file starts with "fub". The command doesn't work if i call the file "fub*" as it doesn't understand I meant a... (2 Replies)
Discussion started by: buj
2 Replies

6. Shell Programming and Scripting

Find out whether files exist.

I have the following data stored in a file. 1 /home/file13 /home/file2 2 /home/file41 /home/file654 3 /home/file61 /home/file45 4 /home/file81 /home/file43 ... I want to print the first column provided the files represented by the second and third column exist. How to do that? (3 Replies)
Discussion started by: kevintse
3 Replies

7. Shell Programming and Scripting

find + move if destination path does not exist

hi frnds, please help ... what will happen with below command if destination path does not exist on the system.... find /var/adm/cft* -mtime +1 -exec mv {} /global/ \ in unix its remove all my files from the system from soruce file ... how is it possbile (1 Reply)
Discussion started by: dodasajan
1 Replies

8. Shell Programming and Scripting

Find if a directory exist from a list of the path

Hello, i want to script on sh to check from a path if the directory exist and isn't empty. I explain: path is : /aaa/bbb/ccc/ccc_name/ddd/ Where the cccc_name is in a list, so i think it's $1 My command find -name /aaa/bbb/ccc/$1/ddd/ didn't work because my $1 is the same and not... (5 Replies)
Discussion started by: steiner
5 Replies

9. Shell Programming and Scripting

Find command when there exist many files

I want to run find and wondering if it struggles when there are many files. I have tried and does not seem to complain. Is this correct? (8 Replies)
Discussion started by: kristinu
8 Replies

10. UNIX for Advanced & Expert Users

Isql and If Exist syntax error in UNIX script

Hello Everyone, Coming again for your help to solve the below error: In a script, i had created a temp table (Temp_table) and loaded the data in it using bcp command (performed successfully) and I wanted to move it to the preferred table (called Main_table) for further use. hence I have added... (7 Replies)
Discussion started by: Suresh
7 Replies
oidentd_masq.conf(5)						File Formats Manual					      oidentd_masq.conf(5)

NAME
oidentd_masq.conf - oidentd IP masquerading/NAT configuration file. DESCRIPTION
If you are using IP masquerading or NAT, oidentd can optionally return a username for connections from other machines. Support for this is specified by calling oidentd with the -m (or --masq) flag and by creating an /etc/oidentd_masq.conf file. oidentd can also forward requests for an IP masqueraded connection to the machine from which connection originates by way of the -f option. This will only work if the host to which the connection is forwarded is running oidentd with the -P (proxy) flag, or if the host's ident daemon will return a valid reply regardless of the input supplied by and the address of the host requesting the info (some ident daemons for windows do this, maybe others). FORMAT
<IP Address|Hostname>[/<Mask>] <Ident Response> <System Type> The first field contains the IP address or the hostname of a machine that IP masquerades through the machine on which oidentd runs. The mask parameter can be either a network mask or a mask in CIDR notation. A mask of 24 is equivalent to 255.255.255.0, a mask of 16 is equivalent to 255.255.0.0, etc. The second field specifies the reply that oidentd will return for lookups to the host matching the IP address specified in the first param- eter. The third field specifies the operating system the machine matching the first parameter is running. EXAMPLES
<Host>[/<Mask>] <Ident Response> <System Type> 192.168.1.1 someone UNIX 192.168.1.2 noone WINDOWS 192.168.1.1/32 user1 UNIX 192.168.1.0/24 user3 UNIX 192.168.0.0/16 user4 UNIX somehost user5 UNIX 192.168.1.0/255.255.255.0 user6 UNIX AUTHOR
Ryan McCabe <ryan@numb.org> http://dev.ojnk.net SEE ALSO
oidentd(8) oidentd.conf(5) version 2.0.8 13 Jul 2003 oidentd_masq.conf(5)
All times are GMT -4. The time now is 04:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy