The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Help with the History command cleansing_flame UNIX for Dummies Questions & Answers 2 02-04-2008 08:25 AM
History command akash_wagh Filesystems, Disks and Memory 0 08-31-2005 02:54 AM
Command history a25khan UNIX for Dummies Questions & Answers 8 12-10-2003 02:05 AM
command history vikasdeshmukh UNIX for Dummies Questions & Answers 3 11-14-2001 01:37 AM
History Command jack UNIX for Dummies Questions & Answers 2 08-01-2001 10:01 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-18-2006
Registered User
 

Join Date: Sep 2006
Posts: 3
Command history in AIX

Hi All,

I would like to know how to get the command history from the prompt. For example in dos, if we hit the Up Arrow, we get the previous command. I am not getting this in my telnet session (AIX) at the prompt.

I know that if I type history command it will give a list of cammands I typed earlier. But what i need is the short cut key were like the up arrow in dos were in i will get the previous command at the prompt.

Thanks in advance...

Priya
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 09-18-2006
Registered User
 

Join Date: Feb 2005
Location: Broomfield, CO
Posts: 379
Assuming your shell is ksh and you're used to vi:

Code:
$ set -o vi
$ <esc>k
Basically the set command sets your keyboard to use the same basic key commands you can use in vi to get arround. The esc key puts you into command mode just like in vi. From there you can use 'k' to move up in the history, 'j' to move down, 'l' to move left and 'h' to move right. You can also hit '/search term' to search for a command. Those are the ones I use most of the time.

You can also set -o emacs if you know the keystrokes for emacs.

Carl
Reply With Quote
  #3 (permalink)  
Old 09-18-2006
Registered User
 

Join Date: Sep 2006
Posts: 3
It worked....

Thank you very much Carl.....

Priya
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 04:13 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0