bash search multiple string in on line code example

Example 1: bash print lines that contain multiple specific words

# Basic syntax:
grep first_word input_file | grep second_word
# This finds all lines that contain the first_word and then pipes them
# to a second filter that looks for the second_word, resulting in all
# lines that contain both words. Simply add more pipes and greps to 
# return lines that meet other search criteria.

Example 2: bash search multiple string in on line

/packages/cinesite/bin/startapp python -m PIPELINE_MODULE_ROOT:/data/pipeline/branches/origin/DEV-8201_af2_policy_runner -m FTRACK_VERSION:atrack -m FTRACK_SERVER:http://atrack.van.ad.cinesite.com -m SHOW:VBOARD -e PythonNamekoItem -m pyscript:utilities/system/policy_runner.py -- --path-prefix "" --input-file /data/pipeline/sandbox/gyang/tickets/policy_runner/list/csmeta_list_vboard01 --policies van_user_cleanup_action --single-threaded --verbose

Example 3: bash search multiple string in on line

export SHOW=VBOARD

Example 4: bash how to print lines after a matching line

# Basic syntax:
grep -A number word_to_match input_file
# This prints "number" number of lines after and including the first
# line that matches word_to_match in the input_file

# Note, the word_to_match can be any expression that grep uses for 
# 	identifying matches (e.g. including combinations of AND and OR, etc)

Tags:

Misc Example