Use sed command to delete a string or pattern of string in linux.
echo "parrot-bird" | sed 's/-.*$//'
Output:
parrot
Above command will delete anything after the pattern "-".
Use sed command to delete a string or pattern of string in linux.
echo "parrot-bird" | sed 's/-.*$//'
Output:
parrot
Above command will delete anything after the pattern "-".