How do I copy a link in Lynx?

23

10

I'd like to copy the current link to the system's clipboard or write it to a file.

If it isn't possible, I guess I'd have to settle with opening it in an external browser (which I was avoiding in the first place, thus using Lynx), and then copying the opened URL. :-/

Nikki Erwin Ramirez

Posted 2009-12-14T10:41:11.537

Reputation: 2 156

Answers

24

Press Shift+g to show the address of the current document, Shift+e to show the address of the selected link. You can copy the text with your mouse (or the keyboard, if your terminal supports that).

Press a to save the address of a document or link to a (Netscape-alike) bookmark file, by default ~/lynx_bookmarks.html. You can open this in a different browser, it's just HTML.

daxim

Posted 2009-12-14T10:41:11.537

Reputation: 1 072

1This works like a charm - thanks! I was wondering, though, what about links that are too long to fit in the status bar? How do I select/copy those (without having to save it to the bookmarks file and copy it from there)? – 3cheesewheel – 2017-06-21T16:26:22.250

① Scroll with the arrow keys left and right and copy the URL in pieces. Needs assembly in a text editor or similar. ② Resize the terminal emulator window and reduce the font size to minimum. Can fit about 350 characters for the displayed URL with my setup. Assign some keyboard shortcuts if you need to do this often. – daxim – 2017-06-22T14:18:30.907

I know this is old, but you can press L to show a list of all of the links on a page untruncated, and use the previously mentioned methods to copy it. Although, when you copy it there will be newline and padding characters if the link spans more than one line. – K. S. – 2017-07-03T15:41:53.893

1

Apparently, you can also use Ctrl + S to save the URL of the current page or the current link (at least on my version 2.8.8).

(Unfortunately, I'm currently getting an error "Copy to clipboard failed", but maybe someone else is more lucky.)

Stefan van den Akker

Posted 2009-12-14T10:41:11.537

Reputation: 171

I've also posted this answer at https://stackoverflow.com/questions/6864548/how-can-i-copy-a-link-url-in-either-lynx-or-links-to-copy-to-vim/.

– Stefan van den Akker – 2017-03-03T14:35:55.983