Keyboard shortcut to insert text in terminal?

Questions about applications and software
Forum rules
Before you post please read this

Keyboard shortcut to insert text in terminal?

Postby Gaia on Fri May 03, 2013 6:17 pm

Hi,

I'm used to using a Mac and in the Terminal there you can set specific keybindings. For example, I can set Shift + F6 to send a string of text to terminal that I use most often. Is there a way to do that with the Linux Mint terminal? I use guake as well, though I couldn't see any options. Idealy I would like to be able to send a string to terminal via keyboard shortcuts.

Thanks!
Last edited by xenopeek on Sun May 05, 2013 4:14 am, edited 1 time in total.
Reason: Made subject more specific; moved here.
Gaia
Level 1
Level 1
 
Posts: 10
Joined: Thu Apr 25, 2013 3:58 pm

Linux Mint is funded by ads and donations.
 

Re: Keyboard shortcut to insert text in terminal?

Postby vercan on Sun May 05, 2013 6:22 pm

You can copy and paste text to and from the terminal, simply use the shortcuts: Ctrl+Shift+C for Copy and: Ctrl+Shift+V for Paste. All applications recognize Ctrl+C for Copy and Ctrl+V for Paste, but the terminal needs the Shift key also.
vercan
Level 1
Level 1
 
Posts: 3
Joined: Sun May 05, 2013 6:17 pm

Re: Keyboard shortcut to insert text in terminal?

Postby Gaia on Sun May 05, 2013 6:24 pm

Thanks, though I mean without needing copy/paste :) I want to define a set of text to a keybinding and be able to insert that text into terminal at any time without having to use the clipboard. It's possible in Mac OSX, but can't seem to find such an option in linux.
Gaia
Level 1
Level 1
 
Posts: 10
Joined: Thu Apr 25, 2013 3:58 pm

Re: Keyboard shortcut to insert text in terminal?

Postby vercan on Sun May 05, 2013 7:00 pm

Oh, I see. If the text you need to send is a linux command, then you could use an alias, like this:

Code: Select all
alias dir="ls -la"


and then, anytime I need to run the: ls -la command, I simply type dir. But if you need to send text that will be part of a more complex command, then the alias won't work for you.

If this is a solution for you, then you would add all your aliases commands to your ~/.bashrc file.
vercan
Level 1
Level 1
 
Posts: 3
Joined: Sun May 05, 2013 6:17 pm

Re: Keyboard shortcut to insert text in terminal?

Postby Gaia on Sun May 05, 2013 8:50 pm

vercan wrote:Oh, I see. If the text you need to send is a linux command, then you could use an alias, like this:

Code: Select all
alias dir="ls -la"


and then, anytime I need to run the: ls -la command, I simply type dir. But if you need to send text that will be part of a more complex command, then the alias won't work for you.

If this is a solution for you, then you would add all your aliases commands to your ~/.bashrc file.


Aliases won't work as it's not always local. I'll need to be able to send the text to various ssh sessions, so won't have access to that specific alias unless I configure it on each server I access. I'd need a way to be able to send the text from a local shortcut to any terminal window, no matter the location. Mac OSX does it so there must be a way :?
Gaia
Level 1
Level 1
 
Posts: 10
Joined: Thu Apr 25, 2013 3:58 pm


Return to Software & Applications

Who is online

Users browsing this forum: No registered users and 22 guests