(1) Edit file named test.txt and ad the string " world" at the end and then quit and save
$ vi test.txt -c ':%s/$/ world/' -c ':wq!'