Binding a command to a keystroke - terminal sessions

 in

OK, so I have moderate Linux experience on servers, but am finally using Gnome on a desktop daily and have one problem I would love to have solved.

I used to use Van Dyke's SecureCRT on my Windows laptop, and really just trying to replicate its behavior. I have a gnome-terminal icon setup to run an SSH script that prompts me for a host name, then logs me in. Not too tough. T opens another SSH session. Again, not too difficult.
What I can't figure out is, I want to bind a keystroke to a command, i.e. in any SSH gnome-terminal window I want to be able to hit J and have it output:
ps -ef | grep [j]ava | gawk -F ' ' ' { print $2,"\t",$NF} ' | sort -k 2
I've got hundreds of hosts that don't all have access to the same location to run the same set of commands, and I don't have the ability to customize root's/other users' rc files to setup aliases.

I was hoping I could use the Gnome's keyboard shortcuts to dump the output of a file on my local system to the gnome-terminal window, but that doesn't seem to work. Am I perhaps overlooking something SSH could do for me? Or is there some other hack somebody else has figured out?

Webcast
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers

Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.

Learn More

Sponsored by AMD

White Paper
Red Hat White Paper: Using an Open Source Framework to Catch the Bad Guy

Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6

Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.

Learn more about catching the bad guy in this free white paper.

Learn More

Sponsored by DLT Solutions