Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Grep? - using a file of terms to search another file when the information is on a different line Post 302843667 by Twinklefingers on Wednesday 14th of August 2013 10:56:36 AM
Old 08-14-2013
It does, but I don't know how to combine -f with -B
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to search a large file with a list of terms in another file

Hi- I am trying to search a large file with a number of different search terms that are listed one per line in 3 different files. Most importantly I need to be able to do a case insensitive search. I have tried just using egrep -f but it doesn't seam to be able to handle the -i option when... (3 Replies)
Discussion started by: dougzilla
3 Replies

2. Shell Programming and Scripting

copying file information using awk & grep

Hi, TASK 1: I have been using this code to print the information of files kept at "/castor/cern.ch/user/s/sudha/forPooja" in some text file name FILE.txt. rfdir /castor/cern.ch/user/s/sudha/forPooja | grep data | awk '{print "rfio:///castor/cern.ch/user/s/sudha/forPooja/"$9}' > FILE.txt ... (6 Replies)
Discussion started by: nrjrasaxena
6 Replies

3. Shell Programming and Scripting

Find common terms in two text file, xargs, grep

Hello, I'm interested in finding all occurrences of the terms in file1 in file2, which are both csv files. I can do this with a loop but I'm interested in knowing if I can also do it with the help of xargs and grep. What I have tried: cat file1 | xargs grep file2 The problem is that... (15 Replies)
Discussion started by: eon
15 Replies

4. Shell Programming and Scripting

Grep'ing information from a log file on SUN OS 5

Hi Guys, I'm trying to write an script that will be launched by a user. The script will look at a log file and check for alerts with the date (supplied by user) and a machine's hostname (also supplied by the user). I'm trying to get the output formatted just like the log file. The logfile looks... (5 Replies)
Discussion started by: illgetit
5 Replies

5. Shell Programming and Scripting

Grep multiple search terms with context

I have a file that is a sort library in the format: ##def title1 content1 stuff1 content2 stuff2 ##enddef ##def title2 etc.. I want to grep def and content and pull some trailing context from content so the result would look something like: (1 Reply)
Discussion started by: Moe.Wilensky
1 Replies

6. UNIX for Dummies Questions & Answers

Obtaining File information based on String Search

Is there a single Command in Unix to get the following Information when searching for files containing one or more strings in a Unix Directory (including sub directories within it) : 1) Complete filename ( path and filename) 2) Owner of the file 3) Size of the file 4) Last Modified date... (3 Replies)
Discussion started by: pchegoor
3 Replies

7. UNIX for Dummies Questions & Answers

Grep -B used with -f? (Searching a file using a list of terms, output is lines before each match)

(1 Reply)
Discussion started by: Twinklefingers
1 Replies

8. UNIX for Dummies Questions & Answers

Search file and print everything except multiple search terms

I'm trying to find a way to search a range of similar words in a file. I tried using sed but can't get it right:sed 's/\(ca01\)*//'It only removes "ca01" but leaves the rest of the word. I still want the rest of the information on the lines just not these specific words listed below. Any... (3 Replies)
Discussion started by: seekryts15
3 Replies

9. Shell Programming and Scripting

Perl to extract information from a file line by line

In the below perl code I am using tags within each line to extract certain information. The tags that are used are: STB >0.8 is STRAND BIAS otherwise GOOD FDP is the second number GO towards the end of the line is read into an array and the value returned is outputed, in the first line that... (1 Reply)
Discussion started by: cmccabe
1 Replies

10. UNIX for Beginners Questions & Answers

Search for the information at file

I'm having few question. i'm have a input file. Other information CONNECTIONS "BP-COLLECTOR" J6.4 "BP-TEST".4; +5VS C34.1 U21.1; DEV_I2C_SDA J6.6 R4.1 U18.1; DEVICES "BP-TEST" 1."BP-LED_ANODE" (8 Replies)
Discussion started by: kttan
8 Replies
BOS_PRUNE(8)						       AFS Command Reference						      BOS_PRUNE(8)

NAME
bos_prune - Removes obsolete files from /usr/lib/openafs and /var/log/openafs SYNOPSIS
bos prune -server <machine name> [-bak] [-old] [-core] [-all] [-cell <cell name>] [-noauth] [-localauth] [-help] bos p -s <machine name> [-b] [-o] [-co] [-a] [-ce <cell name>] [-n] [-l] [-h] DESCRIPTION
The bos prune command removes files from the local disk of the server machine named by the -server argument, as specified by one or more of the following flags provided on the command line: o The -bak flag removes all files from the /usr/lib/openafs directory that have a ".BAK" extension. o The -old flag removes all files from the /usr/lib/openafs directory that have a ".OLD" extension. o The -core flag removes all files from the /var/log/openafs directory that have a "core." prefix. o The -all flag removes all three types of files at once. (If none of these flags are included, the command appears to succeed, but removes no files at all.) To display the timestamp on the current, ".BAK", and ".OLD" versions of one or more files, use the bos getdate command. OPTIONS
-server <machine name> Indicates the server machine from which to remove files. Identify the machine by IP address or its host name (either fully-qualified or abbreviated unambiguously). For details, see bos(8). -bak Removes all files from the /usr/lib/openafs directory that have a ".BAK" extension. Do not combine this flag and the -all flag. -old Removes all files from the /usr/lib/openafs directory that have a ".OLD" extension. Do not combine this flag and the -all flag. -core Removes all files from the /var/log/openafs directory that have a "core." prefix. Do not combine this flag and the -all flag. -all Combines the effect of the -bak, -old, and -core flags. Do not combine this flag with any of those three. -cell <cell name> Names the cell in which to run the command. Do not combine this argument with the -localauth flag. For more details, see bos(8). -noauth Assigns the unprivileged identity "anonymous" to the issuer. Do not combine this flag with the -localauth flag. For more details, see bos(8). -localauth Constructs a server ticket using a key from the local /etc/openafs/server/KeyFile file. The bos command interpreter presents the ticket to the BOS Server during mutual authentication. Do not combine this flag with the -cell or -noauth options. For more details, see bos(8). -help Prints the online help for this command. All other valid options are ignored. EXAMPLES
The following example removes all files from the /usr/lib/openafs directory on the machine "fs3.abc.com" that have a ".BAK" or ".OLD" extension. % bos prune -server fs3.abc.com -bak -old The following example removes all files from the /usr/lib/openafs directory on the machine "db2.abc.com" that have a ".BAK" or ".OLD" extension, and all files from the /var/log/openafs directory that have a "core." prefix. % bos prune -server db2.abc.com -all PRIVILEGE REQUIRED
The issuer must be listed in the /etc/openafs/server/UserList file on the machine named by the -server argument, or must be logged onto a server machine as the local superuser "root" if the -localauth flag is included. The bos prune command cannot be run against servers which are in restricted mode. SEE ALSO
KeyFile(5), UserList(5), bos(8), bos_getdate(8) COPYRIGHT
IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved. This documentation is covered by the IBM Public License Version 1.0. It was converted from HTML to POD by software written by Chas Williams and Russ Allbery, based on work by Alf Wachsmann and Elizabeth Cassell. OpenAFS 2012-03-26 BOS_PRUNE(8)
All times are GMT -4. The time now is 01:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy