Tag Info

New answers tagged


You can alias xclip to behave like pbcopy/pbpaste on OS X. alias pbcopy='xclip -selection clipboard' alias pbpaste='xclip -selection clipboard -o' And then fill and retrieve with e.g. | pbcopy and pbpaste >. Although if you're using a keybinding to do the copying part I guess you'll only need the latter. If you're using it on a remote server you need ...


If you're using bash as your shell, you can press Ctrl-X Ctrl-E to bring up an editor (defined by $VISUAL or $EDITOR, e.g. vi or perhaps nano). You can then paste your commands into that exactly as you would if you were editing a file. They will be executed if you save and exit. Or cancelled if you quit without saving.


The text you're pasting includes a trailing newline. When you paste a newline, the shell running in the terminal sees that as pressing Enter, so it executes the command. The paste operation is performed by the terminal emulator; it passes the pasted text to the application running in the terminal, in the same way that it passes the text typed by the user. ...


To do a multi-line paste onto a command prompt, open single or double quotes before pasting. $ echo 'paste ... ... ' Then you can press return to echo it. When you up-arrow, all the lines you pasted will be on one editable line. This works as long as there isn't a single quote in the text you paste.


In a text editor window, use following shortcuts to copy text without \n (the line feed): Shift+Home, Ctrl+Insert – copies part of the line before the cursor. Shift+End, Ctrl+Insert – copies part of the line after the cursor. Home, Shift+End, Ctrl+Insert – copies all the line without \n. In a browser window, or another thing where the text isn’t editable ...


Don't copy multiple lines of text, to paste. I can almost guarantee you're simply copying the last part of the line. If you're triple clicking to copy that line of code you're pasting, you're getting the newline at the end of the line. If you want to be sure, that is really the problem, then copy the entire line, except for the last letter/digit, and see if ...


If you don't mind using a temporary file, you could do: C-a : writebuf filename $ xsel -bi < filename


For OS X users: To copy paste with mouse=a use alt instead of Shift to selec the text. Then cmd-c and cmd-v work as expected. Found this answer here http://stackoverflow.com/a/4608387/671639 after a lot of googling.

Top 50 recent answers are included