Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 11-11-2003, 07:17 AM   #1
LQ Newbie
Registered: Nov 2003
Location: Lansing, Michigan
Distribution: Redhat 9.0
Posts: 10

Rep: Reputation: 0
Method to "Save" a terminal command

I ssh into my web host's server frequently, and I find myself typing that same ssh command over and over. Is there a way to "save" that? I use konsole, if that helps.

In the windoze world, I used PuTTY for ssh, and that let me save a particular address.

Sorry if this is overly simplified or confusing. There's so much I don't know about Linux yet...
Old 11-11-2003, 07:23 AM   #2
jim mcnamara
Registered: May 2002
Posts: 964

Rep: Reputation: 36
If a get what you want - create an alias in your .login or .profile script

alias conn="ssh -l someusername"
Whenever you type conn it is the same as typing the long command.
I just made up a command - you have to change it to what is correct in order to work for you. Better yet, learn about alias. IT's really handy.
Old 11-11-2003, 07:29 AM   #3
LQ Newbie
Registered: Nov 2003
Location: Lansing, Michigan
Distribution: Redhat 9.0
Posts: 10

Original Poster
Rep: Reputation: 0
Wow, thanks! I remember alias from previous Unix classes - never even thought about it. Thanks. I'll do some reading on it. I think it's just what I need!
Old 11-11-2003, 07:46 AM   #4
Registered: Oct 2003
Location: The Forest
Distribution: Ubuntu, LFS, DSL
Posts: 127

Rep: Reputation: 16

You can use PuTTY under linux. The RPM for Redhat 9
is right here.

I also am a big fan of PuTTY. But it is just a pretty shell for
starting an ssh or telnet session. Mr. Mcnamara's suggestion
would be the more efficient one.


p.s. Efficient, and you learn something about the underpinnings of
the system you are working on. None of that "ignore the man
behind the curtain" stuff.

Last edited by Engmar; 11-11-2003 at 07:49 AM.
Old 11-11-2003, 08:16 AM   #5
LQ 5k Club
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,087

Rep: Reputation: 407Reputation: 407Reputation: 407Reputation: 407Reputation: 407
...and don't forget


and then scroll, copy, and paste


history | grep part_of_that_long_command

or use the up-arrow in konsole.

All these should help
Old 11-11-2003, 08:22 AM   #6
LQ Newbie
Registered: Nov 2003
Location: Lansing, Michigan
Distribution: Redhat 9.0
Posts: 10

Original Poster
Rep: Reputation: 0
Wow, thanks all of you. I don't think I ever knew about the history command.

There's so much I don't know, and so much I've forgotten - but I love Linux. It's so great.

Thanks again for all the help!
Old 11-11-2003, 09:57 AM   #7
Senior Member
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
You can also bang it - if my last command using 'foo' was 'foo some really long stupid thing I don't want to type again' then '!foo' will execute the whole string of the last foo. Even '!f' will if I haven't typed another 'f' command.
Old 11-11-2003, 10:04 AM   #8
Registered: Sep 2001
Distribution: Gentoo
Posts: 760

Rep: Reputation: 31
You can also configure options for a server in the SSH config file (~/.ssh/config)


Host myhost
User myUsername
LocalForward 1234 localhost:1234
Old 11-12-2003, 07:21 AM   #9
LQ Newbie
Registered: Nov 2003
Location: Bangalore,India.
Posts: 20

Rep: Reputation: 0
Type Ctrl+r at command prompt.
then type briskly any two characters of the long command line you are using ( try unique characters)
you may arrive at the command at your command prompt.

did it work? plz mail me if you find time.
I am also a Linux newbie. Lets get improved.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Firefox freezes at "Save", "Download" kjmorris Linux - Software 4 10-27-2004 03:44 PM
Sound: "play command" terminal gone? eyewittness Linux - Software 6 07-10-2004 09:27 AM
Terminal command for GUI command "Remove to trash" GunSkit Linux - General 3 06-29-2004 02:50 PM
"segmentation error" when issuing "useradd" command through terminal with RH 9.0 kaihuang Linux - General 0 10-22-2003 12:47 AM
Can't locate object method "splitpath" via package "File::Spec" RobJohnston Linux - General 2 06-28-2003 10:59 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:44 PM.

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