LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 11-11-2003, 06:17 AM   #1
avarweth
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, 06:23 AM   #2
jim mcnamara
Member
 
Registered: May 2002
Posts: 964

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

Code:
alias conn="ssh -l someusername login.mysite.com"
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, 06:29 AM   #3
avarweth
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, 06:46 AM   #4
Engmar
Member
 
Registered: Oct 2003
Location: The Forest
Distribution: Ubuntu, LFS, DSL
Posts: 127

Rep: Reputation: 16
Cool

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.

Engmar

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 06:49 AM.
 
Old 11-11-2003, 07:16 AM   #5
tredegar
Guru
 
Registered: May 2003
Location: London, UK
Distribution: Ubuntu 10.04, mostly
Posts: 6,007

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

history

and then scroll, copy, and paste

or

history | grep part_of_that_long_command

or use the up-arrow in konsole.

All these should help
 
Old 11-11-2003, 07:22 AM   #6
avarweth
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, 08:57 AM   #7
slakmagik
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, 09:04 AM   #8
dorward
Member
 
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)

e.g.

Host myhost
HostName my.ssh.server.on.the.net
User myUsername
LocalForward 1234 localhost:1234
etc
 
Old 11-12-2003, 06:21 AM   #9
yarnar
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 yarnar@rediffmail.com if you find time.
I am also a Linux newbie. Lets get improved.
 
  


Reply


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


All times are GMT -5. The time now is 06:00 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration