25

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. :-/

26

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.

3
  • 1
    This 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 Jun 21 '17 at 16:26
  • ① 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 Jun 22 '17 at 14:18
  • 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. Jul 3 '17 at 15:41
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.)

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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