Notices
Computer/Internet Issues & Troubleshooting Anyone with questions about the terribly complex world of computers or the internet should try here. NOT FOR REPORTING ISSUES WITH PPRuNe FORUMS! Please use the subforum "PPRuNe Problems or Queries."

UNIX command for line buffer

Old 26th February 2007 | 12:47
  #1 (permalink)  
Thread Starter
 
Joined: Jan 2005
Posts: 84
Likes: 0
From: Brighton, East Sussex, UK
UNIX command for line buffer

Does anyone know the UNIX command to remember the last commands typed.
I know the BASH shell does this but I'm trying to remember this command.
I think it done with KSH, and it something -i vi
I'm a bit rusty on Unix.


Rans.
www.FlightForLife.co.uk
Rans Flyer is offline  
Reply
Old 26th February 2007 | 13:00
  #2 (permalink)  
sir
Basia Arma
25 Anniversary
 
Joined: Apr 2001
Posts: 64
Likes: 26
From: button moon
Not sure if this is what you're after :

typing "history" gives you a list of the last commands.

To get a historical command to rerun use the exclamation mark - eg :

unix%: history

1001 vi render.php
1002 vi add_item.php
1003 vi render.php
1004 vi edit_blog_item.php
1005 vi edit_page.php
1006 vi edit_blog.php
1007 history

unix%: !h

...will run the history command again - the last one beginning with h.

or

unix%: !1003

will run item 1003 (vi render.php) from the list
sir is offline  
Reply
Old 26th February 2007 | 13:10
  #3 (permalink)  
Thread Starter
 
Joined: Jan 2005
Posts: 84
Likes: 0
From: Brighton, East Sussex, UK
Thank you Sir!

It was the history command and the "[CTRL] P" I was after.


Thanks,

Rans
www.FlightForLife.co.uk
Rans Flyer is offline  
Reply
Old 26th February 2007 | 15:04
  #4 (permalink)  
20 Anniversary
 
Joined: Apr 2004
Posts: 152
Likes: 9
From: Crawley
On some version of the ksh if you type:
set -o vi

this will enable you to use command completion.
Also type ESC k to get last commands

For command completion type a part of the command and hit ESC ESC
if the command has been type before it will attempt to complete the rest of the line for you.
pmills575 is offline  
Reply

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Thread Tools
Search this Thread

Contact Us - Archive - Advertising - Cookie Policy - Privacy Statement - Terms of Service

Copyright © 2026 MH Sub I, LLC dba Internet Brands. All rights reserved. Use of this site indicates your consent to the Terms of Use.