Sponsored Content
Top Forums UNIX for Dummies Questions & Answers grep required pattern and next 2 or 3 lines Post 302163459 by sandeepspecial on Friday 1st of February 2008 04:16:45 AM
Old 02-01-2008
this also

can u say how to print the line above that search string?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Grep with 8 lines before and after pattern.

OK. I have a file I'd like to be able to grep, but on top of returning the line where the pattern matches, I'd like to be able to get the previous 8 lines and the following 8 lines. Is there a way to do this? (2 Replies)
Discussion started by: mrwatkin
2 Replies

2. Shell Programming and Scripting

Help required on grep command(Skip the first few lines from printing in the output)

Hi experts I want the proper argument to the grep command so that I need to skip the first few lines(say first 10 lines) and print all the remaining instances of the grep output. I tried to use grep -m 10 "search text" file*. But this gives the first 10 instances(lines) of the search string.... (7 Replies)
Discussion started by: ks_reddy
7 Replies

3. Shell Programming and Scripting

Goto each directory and subdirectories and grep the required pattern

Hi All, I need your help in finding pattern from files present in different directories. I need to search for a pattern "xyz" from "*.txt" files which are present in different levels of directories as shown. example ------- dir1/subdir1/file.txt dir2/subdir2/subsubdir2/file.txt... (5 Replies)
Discussion started by: imas
5 Replies

4. Shell Programming and Scripting

Grep pattern from different file and display if it exists in the required file

Hi, I have two files say xxx.txt and yyy.txt. xxx.txt is with list of patterns within double quotes. Eg. "this is the line1" "this is the line2" The yyy.txt with lot of lines. eg: "This is a test message which contains rubbish information just to fill the page which is of no use. this is... (3 Replies)
Discussion started by: abinash
3 Replies

5. Shell Programming and Scripting

Grep the word from pattern line and update in subsequent lines till next pattern line reached

Hi, I have got the below requirement. please suggest. I have a file like, Processing Item is: /data/ing/cfg2/abc.txt /data/ing/cfg3/bgc.txt Processing Item is: /data/cmd/for2/ght.txt /data/kernal/config.klgt.txt I want to process the above file to get the output file like, ... (5 Replies)
Discussion started by: rbalaj16
5 Replies

6. Shell Programming and Scripting

Sed/awk : to grep only required pattern disk

Hi Experts, Need help with the following: Desired output: Only want to get the output marked in green. The file: --- Physical volumes --- PV Name /dev/disk/disk4704 PV Status available Total PE 6399 Free PE ... (3 Replies)
Discussion started by: rveri
3 Replies

7. Shell Programming and Scripting

Grep lines before a pattern having some other pattern

Hi All, I am trying to fetch lines before a pattern, I got to know about -B flag in grep but we have to pass the number to get those lines before some pattern say (X), now what if I want to get line/s with some other pattern say (Y) before X pattern? How to get about it? please help. Input:... (5 Replies)
Discussion started by: dips_ag
5 Replies

8. UNIX for Dummies Questions & Answers

Grep -v lines starting with pattern 1 and not matching pattern 2

Hi all! Thanks for taking the time to view this! I want to grep out all lines of a file that starts with pattern 1 but also does not match with the second pattern. Example: Drink a soda Eat a banana Eat multiple bananas Drink an apple juice Eat an apple Eat multiple apples I... (8 Replies)
Discussion started by: demmel
8 Replies

9. Shell Programming and Scripting

Grep all lines with the pattern .sh

Linux version : Oracle Linux 6.5 Shell : bash In the the below text file (someString.text), I want to grep all lines with .sh in it. ie. Only the lines mysript.sh and anotherscript.sh should be returned. My below attempts failed. I gather that in regular expression world, dot (.) is the... (3 Replies)
Discussion started by: John K
3 Replies

10. UNIX for Beginners Questions & Answers

Reading a file line by line and print required lines based on pattern

Hi All, i want to write a shell script read below file line by line and want to exclude the lines which contains empty value for MOUNTPOINT field. i am using centos 7 Operating system. want to read below file. # cat /tmp/d5 NAME="/dev/sda" TYPE="disk" SIZE="60G" OWNER="root"... (4 Replies)
Discussion started by: balu1234
4 Replies
IMDB-TOOLS(1)						      General Commands Manual						     IMDB-TOOLS(1)

NAME
imdb-get -- Looks up IMDB data for a film. SYNOPSIS
imdb-get [options] [--imdb-id id] [-l id] [--search search string] [-s search string] [--filename filename] [-f filename] [-h ] [--help] DESCRIPTION
This manual page documents briefly the imdb-get command. imdb-get has three modes. It can be called with imdb ID and a set of details to print, in which case it will retrieve those details either from the cache or IMDB. Secondly, it can be called with a filename in which case it will look the file up in the cache (resolving symlinks as appropriate and checking for multiple disks from the same film) and if that fails it will use the filename to search IMDB. Alterna- tively it may be used with just a search string, which will always search IMDB. OPTIONS
These programs follow the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. -h --help Print syntax and options. -l --imdb-id Specify IMDBID to use in queries. -s --search Specify search string to use in queries. -f --filename Specify filename. Will be used to form search queries if no ID or search string is specified. -i --id Print IMDB ID (default if nothing else is selected). -t --title Print film title. -g --genre Print film genres. --tag Print film tag line. -y --year Print film year. -c --cover Print cover art URI. -m --print-filename Print film genres. -a --all Print all film details. -e --cachedir Set cache directory. -d --download-cover Download cover art locally. -r --refresh Force an update from IMDB not the cache. -n --rename Rename file based on IMDB title. -u --update-filename Update the filename in a stored record --prune-duplicates Removes cache files with duplicate filename entries. (Removes all but the most recently modified cache file) --refresh-cache Refresh all the details in the cache from IMDB (may be slow). FILES
Config options are read from /etc/imdbgetrc or $HOME/.imdbgetrc SEE ALSO
imdb(1) imdb-rename(1) imdb-link(1) imdb-update-cache(1) imdbgetrc(5) imdb-fxd(1) AUTHOR
This manual page was written by Matthew Johnson <debian@matthew.ath.cx>. Permission is granted to copy, distribute and/or modify this docu- ment under the terms of the GNU General Public License, Version 2 as published by the Free Software Foundation. On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL-2. IMDB-TOOLS(1)
All times are GMT -4. The time now is 06:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy