this post was submitted on 09 Apr 2024
314 points (98.8% liked)

Linux

48200 readers
989 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

I thought I'll make this thread for all of you out there who have questions but are afraid to ask them. This is your chance!

I'll try my best to answer any questions here, but I hope others in the community will contribute too!

you are viewing a single comment's thread
view the rest of the comments
[–] cosmicrookie@lemmy.world 13 points 7 months ago (18 children)

In the terminal, why can't i paste a command that i have copied to the clipboard, with the regular Ctrl+V shortcut? I have to actually use the mouse and right click to then select paste.

(Using Mint cinnamon)

[–] cyclohexane@lemmy.ml 10 points 7 months ago

The terminal world has Ctrl+C and Ctrl+(many other characters) already reserved for other things before they ever became standard for copy paste. For for this reason, Ctrl+Shift+(C for copy, V for paste) are used.

In Terminal land, Ctrl+C has meant Cancel longer than it's meant copy. Shift + Insert does what you think Ctrl+V will do.

Also, there's a separate thing that exists in most window managers called the Primary buffer, which is a separate thing from the clipboard. Try this: Highlight some text in one window, then open a text editor and middle click in it. Ta da! Reminder: This has absolutely nothing to do with the clipboard, if you have Ctrl+X or Ctrl+C'd something, this won't overwrite that.

[–] r0ertel@lemmy.world 9 points 7 months ago (1 children)

Old timer here! As many others replying to you indicate, Ctrl+C means SIGINT (interrupt running program). Many have offered the Ctrl+Shift+C, but back in my day, we used Shift+Insert (paste) and Ctrl+Insert (copy). They still work today, but Linux has 2 clipboard buffers and Shift+Insert works against the primary.

As an aside, on Wayland, you can use wl-paste and wl-copy in your commands, so git clone "$(wl-paste)" will clone whatever repo you copied to your clipboard. I use this one all the time

[–] Trainguyrom@reddthat.com 3 points 7 months ago (1 children)

so git clone "$(wl-paste)" will clone whatever repo you copied to your clipboard. I use this one all the time

That's a lot of confidence in not accidentally grabbing a leading/trailing space and grabbing unformatted text. I never trust that I've copied clean text and almost exclusively Ctrl+Shift+V to paste without formatting

[–] r0ertel@lemmy.world 1 points 7 months ago

You're probably correct. I guess I only do this with right click, copy of URLs.

[–] been_jamming@lemm.ee 8 points 7 months ago

Does Ctrl+Shift+V work?

[–] Allero 4 points 7 months ago

Due to some old school terminal things. Add shift to shortcut combinations, such as Ctrl+Shift+V to paste.

[–] ArcaneSlime@lemmy.dbzer0.com 3 points 7 months ago

Try ctrl+shift+v, iirc in the terminal ctrl+v is used as some other shortcut (and probably has been since before it was standard for "paste" I'd bet).

Also linux uses two clipboards iirc, the ctrl+c/v and the right click+copy/paste are two distinct clipboards.

[–] Thymos@lemm.ee 3 points 7 months ago

What usually also works on Linux is selecting text with the mouse and pasting it by pressing the middle mouse button (or scroll wheel). You'd still need the mouse, but it's at least a little quicker ☺️

[–] baseless_discourse@mander.xyz 3 points 7 months ago* (last edited 7 months ago) (1 children)

In most terminal (gnome terminal, blackbox, tilix etc.) you can actually override this behavior by changing keyboard shortcut. Blackbox even have a simple toggle that will enable ctrl+c v copy paste.

Gnome console is the only terminal I know that doesn't allow you to change this.

[–] cosmicrookie@lemmy.world 2 points 7 months ago

Interesting! Ill check that out with mint!

[–] blackstrat@lemmy.fwgx.uk 2 points 7 months ago

Try Shift+Insert. That's my preferred pasting method in most scenarios.

[–] wewbull@feddit.uk 2 points 7 months ago (1 children)

...because that would make Ctrl+C Cut/Copy and that would be really bad. It would kill whatever was running.

So, it becomes Ctrl+Shift+C and paste got moved in the same way for consistency.

[–] maxxxxpower@lemmy.ca -1 points 7 months ago

I use Ctrl+C to copy far more often than to break a process or something. I demand that Ctrl+Shift+C be reconfigured! 😀

[–] possiblylinux127@lemmy.zip 2 points 7 months ago

You need to use Ctrl+shift+v

[–] MonkeMischief 1 points 7 months ago* (last edited 7 months ago)

This is a really great question and it was something that tripped me up back in the day!

The answers above cover it already, so upvoting hoping it's more visible. Thanks for asking it. :)

[–] Pesopes@lemm.ee 1 points 7 months ago* (last edited 7 months ago)

Ctrl+V is already a shortcut for something (I don't even know what) but to paste just add shift so Ctrl+Shift+V.

(Also a beginner btw)

[–] u_die_for_elmer@lemm.ee 1 points 7 months ago

Use shift+control+v to paste. Shift+control+c to copy in the terminal. It's this way because control+c in the terminal is to break out of the currently running process.

[–] Plasma@lemmy.ml 1 points 7 months ago

Ctrl+shift+V is what you should do. Ctrl+V is used by shells for I believe inserting characters without doing some sort of evaluation. I don't remember the specifics though, but yes Ctrl+shift+V to paste.

[–] downhomechunk@midwest.social 1 points 7 months ago

Shift + insert

[–] Nyanix@lemmy.ca 1 points 7 months ago

While I don't have the answer as to why, it usually works if you just add a shift, ie. SHIFT+CTRL+V Many terminals also allow you to change the shortcut to copy and paste, so you can adjust for comfort's sake.