This command will return “true” or “false” if strings contain the TARGET. You can supply the STRING from standard input or as a command line argument.
string contains "friend" "The people were freindly"
Would return true
string contains "tomato" "The people were freindly"
Would return false
NOTE: To read content from standard input we use the -i -
option.
echo "The people were friendly" | string -i - contains "friend"
Would return true
echo "The people were friendly" | string -i - contains "apple"
Would return false