I have a large text file that contains a unique string in the middle. I want to print everything AFTER the string by using grep.
cat textfile | grep "target_string"
This highlights target_string but prints the whole file
cat textfile | grep -o "target_string"
This prints only target_string
cat textfile | grep -o "target_string*"
This prints only target_string
How can I print everything after "target_string" and nothing before?
You forgot the '.' in the regular expression:
cat textfile | grep -o "target_string.*"