Sponsored Content
Top Forums UNIX for Dummies Questions & Answers grep/cat/more -- search in a txt file and display content from a specific "keyword" Post 302107716 by I-1 on Tuesday 20th of February 2007 08:46:45 AM
Old 02-20-2007
grep/cat/more -- search in a txt file and display content from a specific "keyword"

Hi,

I have a .txt file

Sample:

Code:
=====================
NEXT HOST
=====================
 AEADBAS001
ip access-list extended BLA_Incoming_Filter
ip access-list extended BLA_Outgoing_Filter
access-list 1 permit xxxxxxxxxxxxxx
access-list 2 permit xxxxxxxxxxxxxx
=====================
NEXT HOST
=====================
 AEADBMP002
access-list 1 permit xxxxxxxxxxxxxx
access-list 2 permit xxxxxxxxxxxxxx
access-list 22 permit xxxxxxxxxxxxxx
=====================
NEXT HOST
=====================
 AEADBMP003
ip access-list extended GAA_Incoming_Filter
ip access-list extended GAA_GW_Outgoing_Filter
access-list 1 permit xxxxxxxxxxxxxx
access-list 2 permit xxxxxxxxxxxxxx

I want to do a more/grep or cat and start the output from this line "AEADBMP002"...

So all the above information is not showed but starting from that point where it findes the string "AEADBMP002" the output is shown.

How do I do that?

Thanks,
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

grep to find content in between curly braces, "{" and "},"

problem String ~~~~~~~~~~~~~~~~~~ icecream= { smart peopleLink "good" LC "happy" , smartpeopleLink "dull" LC "sad" } aend = {smart vc4 eatr kalu} output needed ~~~~~~~~~~~~~~~~~~ smart peopleLink "good" LC "happy" , smartpeopleLink "dull" LC "sad" smart vc4... (4 Replies)
Discussion started by: keshav_rk
4 Replies

2. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

3. Shell Programming and Scripting

ls -laR | grep "^-" | awk '{print $9}'| grep "$.txt"

Hi, I don't know hot to make this command work: ls -laR | grep "^-" | awk '{print $9}'| grep "$.txt" It should return the list of file .txt It's important to search .txt at the end of the line, becouse some file name have "txt" in their name but have other extensions (13 Replies)
Discussion started by: DNAx86
13 Replies

4. Shell Programming and Scripting

Need to search for a file which has a "cad" content in it?

Hi Guys, I need to search for a file which has the "cad" content in it. I forgot the file name. could you people give me the command to figure it out? Thanks Magesh (2 Replies)
Discussion started by: mac4rfree
2 Replies

5. Shell Programming and Scripting

cat $como_file | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g'

hi All, cat file_name | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g' Can this be done by using sed or awk alone (4 Replies)
Discussion started by: harshakusam
4 Replies

6. Shell Programming and Scripting

grep with "[" and "]" and "dot" within the search string

Hello. Following recommendations for one of my threads, this is working perfectly : #!/bin/bash CNT=$( grep -c -e "some text 1" -e "some text 2" -e "some text 3" "/tmp/log_file.txt" ) Now I need a grep success for some thing like : #!/bin/bash CNT=$( grep -c -e "some text_1... (4 Replies)
Discussion started by: jcdole
4 Replies

7. Shell Programming and Scripting

finding the strings beween 2 characters "/" & "/" in .txt file

Hi all. I have a .txt file that I need to sort it My file is like: 1- 88 chain0 MASTER (FF-TE) FFFF 1962510 /TCK T FD2TQHVTT1 /jtagc/jtag_instreg/updateinstr_reg_1 dff1 (TI,SO) 2- ... (10 Replies)
Discussion started by: Behrouzx77
10 Replies

8. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

9. UNIX for Beginners Questions & Answers

How to print the "grep" result as specified keyword order?

I have a content.xls file as given below, NC_020815.1 1891831 1894692 virb4_A0A0H2X8Z4_ 1 954 1945 NC_020815.1 1883937 1886123 vird4_A0A0P9KA26_ 1 729 1379 NC_020815.1 2976151 2974985 virb10_H8FLU5_Ba 1 393 478 NC_020815.1 2968797 2967745 virb6_A0A0Q5GCZ4 5 398 499... (2 Replies)
Discussion started by: dineshkumarsrk
2 Replies

10. AIX

Apache 2.4 directory cannot display "Last modified" "Size" "Description"

Hi 2 all, i have had AIX 7.2 :/# /usr/IBMAHS/bin/apachectl -v Server version: Apache/2.4.12 (Unix) Server built: May 25 2015 04:58:27 :/#:/# /usr/IBMAHS/bin/apachectl -M Loaded Modules: core_module (static) so_module (static) http_module (static) mpm_worker_module (static) ... (3 Replies)
Discussion started by: penchev
3 Replies
PTS_SETFIELDS(1)					       AFS Command Reference						  PTS_SETFIELDS(1)

NAME
pts_setfields - Sets privacy flags or quota for a Protection Database entry SYNOPSIS
pts setfields -nameorid <user or group name or id>+ [-access <set privacy flags>] [-groupquota <set limit on group creation>] [-cell <cell name>] [-noauth] [-localauth] [-force] [-help] pts setf -na <user or group name or id>+ [-a <set privacy flags>] [-g <set limit on group creation>] [-c <cell name>] [-no] [-l] [-f] [-h] DESCRIPTION
The pts setfields command sets the group-creation quota, the privacy flags, or both, associated with each user, machine, or group entry specified by the -nameorid argument. To examine the current quota and privacy flags, use the pts examine command. CAUTIONS
Changing a machine or group's group-creation quota is allowed, but not recommended. The concept is meaningless for machines and groups, because it is impossible to authenticate as a group or machine. Similarly, some privacy flag settings do not have a sensible interpretation. OPTIONS specifies the appropriate settings. OPTIONS
-nameorid <user or group name or id>+ Specifies the name or AFS UID of each user, the IP address (complete or wildcard-style) of each machine, or the name or AFS GID of each machine for which to set privacy flags or group-creation quota. It is acceptable to mix users, machines, and groups on the same command line, as well as names (IP addresses for machines) and IDs. Precede the GID of each group with a hyphen to indicate that it is negative. -access <privacy flags> Specifies the privacy flags to apply to each entry. Provide a string of five characters, one for each of the permissions. If this option is omitted, the current setting remains unchanged. Set each flag to achieve the desired combination of permissions. If the following list does not mention a certain setting, it is not acceptable. For further discussion of the privacy flags, see pts_examine(1). o The first flag determines who can use the pts examine command to display information from a user, machine or group's Protection Database entry. o Set it to lowercase "s" to permit the members of the system:administrators group to display a user, machine, or group entry, the associated user to display a user entry, and the owner or members of a group to display the group entry. o Set it to uppercase "S" to permit anyone who can access the cell's database server machines to display a user, machine, or group entry. o The second flag determines who can use the pts listowned command to list the groups that a user or group owns. o Set it to the hyphen ("-") to permit the members of the system:administrators group and a user to list the groups he or she owns, or to permit the members of the system:administrators group and a group's owner to list the groups that a group owns. o Set it to uppercase letter "O" to permit anyone who can access the cell's database server machines to list the groups owned by a machine or group entry. o The third flag determines who can use the pts membership command to list the groups to which a user or machine belongs, or the users and machines that belong to a group. o Set it to the hyphen ("-") to permit the members of the system:administrators group and a user to list the groups he or she belongs to, to permit the members of the system:administrators group to list the groups a machine belongs to, or to permit the members of the system:administrators group and a group's owner to list the users and machines that belong to it. o Set it to lowercase "m" to permit members of a group to list the other members. (For user and machine entries, this setting is equivalent to the hyphen.) o Set it to uppercase "M" to permit anyone who can access the cell's database server machines to list membership information for a user, machine or group. o The fourth flag determines who can use the pts adduser command to add users and machines as members of a group. This flag has no sensible interpretation for user and machine entries, but must be set nonetheless, preferably to the hyphen. o Set it to the hyphen ("-") to permit the members of the system:administrators group and the owner of the group to add members. o Set it to lowercase "a" to permit members of a group to add other members. o Set it to uppercase "A" to permit anyone who can access the cell's database server machines to add members to a group. o The fifth flag determines who can use the pts removeuser command to remove users and machines from membership in a group. This flag has no sensible interpretation for user and machine entries, but must be set nonetheless, preferably to the hyphen. o Set it to the hyphen ("-") to permit the members of the system:administrators group and the owner of the group to remove members. o Set it to lowercase "r" to permit members of a group to remove other members. -groupquota <group creation quota> Specifies the number of additional groups a user can create (it does not matter how many he or she has created already). Do not include this argument for a group or machine entry. -cell <cell name> Names the cell in which to run the command. For more details, see pts(1). -force Enables the command to continue executing as far as possible when errors or other problems occur, rather than halting execution at the first error. -help Prints the online help for this command. All other valid options are ignored. -localauth Constructs a server ticket using a key from the local /etc/openafs/server/KeyFile file. Do not combine this flag with the -cell or -noauth options. For more details, see pts(1). -noauth Assigns the unprivileged identity anonymous to the issuer. For more details, see pts(1). EXAMPLES
The following example changes the privacy flags on the group "operators", retaining the default values of the first, second and third flags, but setting the fourth and fifth flags to enable the group's members to add and remove other members. % pts setfields -nameorid operators -access S-Mar The following example changes the privacy flags and sets group quota on the user entry "admin". It retains the default values of the first, fourth, and fifth flags, but sets the second and third flags, to enable anyone to list the groups that "admin" owns and belongs to. Users authenticated as "admin" can create an additional 50 groups. % pts setfields -nameorid admin -access SOM-- -groupquota 50 PRIVILEGE REQUIRED
To edit group entries or set the privacy flags on any type of entry, the issuer must own the entry or belong to the system:administrators group. To set group-creation quota on a user entry, the issuer must belong to the system:administrators group. SEE ALSO
pts(1), pts_adduser(1), pts_examine(1), pts_listowned(1), pts_membership(1), pts_removeuser(1) 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 2014-04-08 PTS_SETFIELDS(1)
All times are GMT -4. The time now is 07:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy