get the last word in the line
For example, in vim, after selecting the lines in visual mode:
‘<,’>!awk ‘{ print $NF }’
For example, in vim, after selecting the lines in visual mode:
‘<,’>!awk ‘{ print $NF }’
If you’ve changed your .bashrc in such a way that it does this when you log in:
bash: fork: Resource temporarily unavailable
… then you can fix it like this:
$ exec mv .bashrc .bashrc.old
This replaces all text on each line up to the word “foo”:
:%s/.*\ze\<foo\>//(via)