Sponsored Content
Full Discussion: How to search file content
Operating Systems Linux How to search file content Post 302218752 by Franklin52 on Saturday 26th of July 2008 10:10:28 AM
Old 07-26-2008
Use grep:

Code:
grep [option] pattern [file]

Have a read of the manpage for the options.

Regards
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

shell script to search content of file with timestamps in the directory

hello, i want to make a script to search the file contents in my home directory by a given date and output me the line that has the date... (10 Replies)
Discussion started by: psychobeauty
10 Replies

2. UNIX for Advanced & Expert Users

Search files with specfic extention and later search content

Hi, I would appriciate if somebody can help me figure out how to search for all the *.xml file under a specific directory and subdirectroies (/home/username) and later search of content "<start>" inside the xml file returned by search. -Lovin.V (2 Replies)
Discussion started by: lovi_v
2 Replies

3. UNIX for Dummies Questions & Answers

Search File content.

Hi, I have a problem when searching a file, the file containt with the following: 95671660:Jones:Sarah:45:sales manager 93272658:Smith:John:43:technical manager 98781987:Williams:Nick:35:computer officer 99893878:Brown:Sarah:12:electrician 95673456:Couch:David:26:chef... (3 Replies)
Discussion started by: elenatec
3 Replies

4. Shell Programming and Scripting

Perl search and replace file content.

I am not sure if this is doable. I am trying to open and print the content of the file by replacing all instances fo perl to PERL . This is my code but it is giving me the number count instead of the actual lines with changes. open (PERLHISTORY, 'sample.txt') or die "The file sample.txt could... (3 Replies)
Discussion started by: jxh461
3 Replies

5. Shell Programming and Scripting

Search for string in filename, not file content

How can I search for a string in a filename? For example, I want to know if a filename (not the file contents) contains the string "test". (3 Replies)
Discussion started by: daflore
3 Replies

6. UNIX for Dummies Questions & Answers

Using File Browser to search file content ...

Hello, I'm using rhel6. Using File Browser Nautilus 2.28.4 I could easily locate any file I'm interested in by it name. I'd like to use this File Browser to locate the file name based on it content e.g. based on some word in the text file. It doesn't work for me that way ... My question: does... (0 Replies)
Discussion started by: susja
0 Replies

7. Shell Programming and Scripting

Need to build Shell Script to search content of a text file into a folder consist several files

Have to read one file say sourcefile containing several words and having another folder containing several files. Now read the first word of Sourcefile & search it into the folder consisting sevral files, and create another file with result. We hhave to pick the filename of the file in which... (3 Replies)
Discussion started by: mukesh.baranwal
3 Replies

8. Shell Programming and Scripting

want to search some content of the file with specific to user

I have some users in one unix system and i want to search some files with specific to user and then i want to find some content inside that file so can u help me how we can implement it? File location is as below. /pools/home_unix/cmadireddy/work/models/model/ cmadireddy is user name. now... (6 Replies)
Discussion started by: lathigara
6 Replies

9. Shell Programming and Scripting

Searching the content of one file using the search key of another file

I have two files: file 1: hello.com neo.com,japan.com,example.com news.net xyz.com, telecom.net, highlands.net, software.com example2.com earth.net, abc.gov.uk file 2: neo.com example.com abc.gov.uk file 2 are the search keys to search in file 1 if any of the search key is... (3 Replies)
Discussion started by: csim_mohan
3 Replies

10. Shell Programming and Scripting

Search the specific content from the complex file

Hi, I have a file with complex data without delimiter, have requirement to fetch the specific record based on some charcters. here is my file data ... (12 Replies)
Discussion started by: Riverstone
12 Replies
GNUNET-SEARCH(1)					      General Commands Manual						  GNUNET-SEARCH(1)

NAME
gnunet-search - a command line interface to search for content on GNUnet SYNOPSIS
gnunet-search [OPTIONS] [+]KEYWORD [[+]KEYWORD]* gnunet-search [OPTIONS] [+]URI DESCRIPTION
Search for content on GNUnet. The keywords are case-sensitive. gnunet-search can be used both for a search in the global namespace as well as for searching a private subspace. -a LEVEL, --anonymity=LEVEL The -a option can be used to specify additional anonymity constraints. If set to 0, GNUnet will try to download the file as fast as possible, including using non-anonymous methods. If you set it to 1 (default), you use the standard anonymous routing algorithm (which does not explicitly leak your identity). However, a powerful adversary may still be able to perform traffic analysis (sta- tistics) to over time infer data about your identity. You can gain better privacy by specifying a higher level of anonymity, which increases the amount of cover traffic your own traffic will get, at the expense of performance. Note that your download performance is not only determined by your own anonymity level, but also by the anonymity level of the peers publishing the file. So even if you download with anonymity level 0, the peers publishing the data might be sharing with a higher anonymity level, which in this case will determine performance. Also, peers that cache content in the network always use anonymity level 1. This option can be used to limit requests further than that. In particular, you can require GNUnet to receive certain amounts of traffic from other peers before sending your queries. This way, you can gain very high levels of anonymity - at the expense of much more traffic and much higher latency. So set it only if you really believe you need it. The definition of ANONYMITY-RECEIVE is the following. 0 means no anonymity is required. Otherwise a value of 'v' means that 1 out of v bytes of "anonymous" traffic can be from the local user, leaving 'v-1' bytes of cover traffic per byte on the wire. Thus, if GNUnet routes n bytes of messages from foreign peers (using anonymous routing), it may originate n/(v-1) bytes of queries in the same time-period. The time-period is twice the average delay that GNUnet defers forwarded queries. The default is 1 and this should be fine for most users. Also notice that if you choose very large values, you may end up having no throughput at all, especially if many of your fellow GNUnet-peers all do the same. -c FILENAME, --config=FILENAME use config file (defaults: ~/.gnunet/gnunet.conf) -h, --help print help page -L LOGLEVEL, --loglevel=LOGLEVEL Change the loglevel. Possible values for LOGLEVEL are ERROR, WARNING, INFO and DEBUG. -o FILENAME, --output=FILENAME Writes a GNUnet directory containing all of the search results to FILENAME. -n, --no-network Only search locally, do not forward requests to other peers. -N VALUE, --results=VALUE automatically terminate the search after receiving VALUE results. -t VALUE, --timeout=VALUE Automatically timeout search after VALUE ms. Otherwise the search runs until gnunet-search is aborted with CTRL-C. -v, --version print the version number -V, --verbose print meta data from search results as well NOTES
You can run gnunet-search with an URI instead of a keyword. The URI can have the format for a namespace search or for a keyword search. For a namespace search, the format is gnunet://fs/sks/NAMESPACE/IDENTIFIER. For a keyword search, use gnunet://fs/ksk/KEYWORD[+KEYWORD]*. If the format does not correspond to a GNUnet URI, GNUnet will automatically assume that keywords are supplied directly. If multiple keywords are passed, gnunet-search will look for content matching any of the keywords. The prefix "+" makes a keyword manda- tory. # gnunet-search "Das Kapital" searches for content matching the keyword "Das Kapital". Whereas # gnunet-search +Das +Kapital Searches for content matching both mandatory keywords "Das" and "Kapital". Search results are printed by gnunet-search like this: gnunet-download -o "COPYING" gnunet://fs/chk/HASH1.HASH2.SIZE Description: The GNU Public License Mime-type: text/plain The first line contains the command to run to download the file. The suggested filename in the example is COPYING. The GNUnet URI con- sists of the key and query hash of the file and finally the size of the file. After the command to download the file GNUnet will print meta-data about the file as advertised in the search result, here "The GNU Public License" and the mime-type (see the options for gnunet-publish on how to supply meta-data by hand). FILES
~/.gnunet/gnunet.conf GNUnet configuration file; specifies the default value for the timeout REPORTING BUGS
Report bugs to <https://gnunet.org/bugs/> or by sending electronic mail to <gnunet-developers@gnu.org> SEE ALSO
gnunet-fs-gtk(1), gnunet-publish(1), gnunet-download(1), gnunet-pseudonym(1), gnunet.conf(5), GNUnet 25 Feb 2012 GNUNET-SEARCH(1)
All times are GMT -4. The time now is 01:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy