I am currently running the following two commands.

\rm myfile
vim myfile

Then, i, to enter insert mode, and ctrl-shift-v to paste

Basically I have text on my clipboard that I would like to copy and overwrite my current file.

Can this be done with less work?


See the accepted answer here. You can use xsel to paste directly from your clipboard into a file, using > to overwrite the original file.

xsel --clipboard > path/to/file.txt

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.