Linux tail only whole words
I need to print the last 20 characters of a string, but only whole words. The separator is a space "
". Consider this example:
string = "The quick brown fox jumps over the lazy dog"
echo $ string | tail -c20
returns s over the lazy dog
. And I need him to return over the lazy dog
. Do you know how to do it? Thank!
+2
source to share