LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-18-2021, 06:54 AM   #1
ccee
LQ Newbie
 
Registered: Jan 2007
Posts: 10
Blog Entries: 1

Rep: Reputation: 0
copy paste in bash without the colon


Hello

Traditionally in bash if you wanted to copy/paste a word you would hover the mouse above the source word and double click to select that word. In newer (at least debian based) installs I have found that if that word is followed by a colon then the colon is also included in what has been selected.
For example:

cat /etc/passwd | grep nobody
nobody:x:65534:65534::/tmp:

if I hovered the mouse above "nobody" and double right click, "nobody" was selected ...
If I now do the same thing in 4.9.0-264-antix.1-amd64-smp (and several others) the whole line is selected...

How can I delimit what is selected by considering the colon as if it were a space like in the good old days?

Thanks

C
 
Old 08-18-2021, 07:49 AM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,008

Rep: Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193
A quick google found me:

https://unix.stackexchange.com/quest...terminal#45927

Should get you started at least
 
Old 08-18-2021, 07:57 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,140

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
Sometimes the most benign threads open my eyes to things I hadn't even considered.
Thank you folks.
 
Old 08-19-2021, 01:41 AM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by ccee View Post
Traditionally in bash if you wanted to copy/paste a word you would hover the mouse above the source word and double click to select that word.
This is a feature of the terminal emulator software you are using, not the shell.
So, post #2 should indeed get you started.
 
Old 08-19-2021, 01:56 AM   #5
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,332
Blog Entries: 3

Rep: Reputation: 3727Reputation: 3727Reputation: 3727Reputation: 3727Reputation: 3727Reputation: 3727Reputation: 3727Reputation: 3727Reputation: 3727Reputation: 3727Reputation: 3727
In XFCE4-Terminal, the word definition can be customized under Edit -> Preferences -> Advanced -> Double Click

Then remove the colon or any other problem characters.

The process should be rather similar for other terminals. Which terminal emulator are you using?
 
Old 08-19-2021, 03:44 AM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,930

Rep: Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321
additionally: double click selects word, triple click selects the whole line (probably it depends on the emulator too).
as it was mentioned you can specify word delimiters, which can influence how double click works (also depends on the emulator).
Especially if you remove colon from this list double click will select the whole line (of /etc/passwd).
 
Old 08-19-2021, 11:52 AM   #7
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
You can also, in most terminal emulators, use a left-click and hold to drag the highlight for what you want to copy (instead of hovering) then once highlighted a right click should bring up a menu to select copy.
 
Old 08-20-2021, 12:23 AM   #8
Brains
Senior Member
 
Registered: Apr 2009
Distribution: All OS except Apple
Posts: 1,591

Rep: Reputation: 389Reputation: 389Reputation: 389Reputation: 389
Quote:
Originally Posted by computersavvy View Post
You can also, in most terminal emulators, use a left-click and hold to drag the highlight for what you want to copy (instead of hovering) then once highlighted a right click should bring up a menu to select copy.
That's complicated, left, drag, right, left, double right is the speed freak's preference. Not that I care or do that.
EDIT: I consider myself complex, as such I go the complicated route

Last edited by Brains; 08-20-2021 at 12:30 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy and Paste - make /qmake fails when Linux "paste" include ( ) in name jan128 Linux - Newbie 4 01-30-2021 05:01 AM
[SOLVED] bash: Can't split string at colon (pure bash) L_Carver Linux - Newbie 3 12-02-2018 12:09 PM
[SOLVED] Preventing the screen copy and paste error on first paste slackartist Slackware 0 04-03-2016 06:48 PM
BASH: Purpose of the : (colon) vrillusions Programming 4 12-29-2005 01:27 PM
Cannot copy filename with colon to floppy JohnKFT Slackware 5 10-02-2004 05:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration