LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-29-2003, 09:32 AM   #1
Siki
LQ Newbie
 
Registered: Jul 2003
Posts: 3

Rep: Reputation: 0
Command Question


Quick question: Is there a command for repeating a command after executing the command (ex., the F3 key in Windows/DOS)? I haven't found this listed yet in my Linux books. Thanks!
 
Old 07-29-2003, 09:38 AM   #2
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 58
up arrows will take you through the last commands in bash history.

Last edited by fancypiper; 07-29-2003 at 09:39 AM.
 
Old 07-29-2003, 09:59 AM   #3
jpbarto
Senior Member
 
Registered: Mar 2003
Location: Pittsburgh, PA
Distribution: Gentoo / NetBSD
Posts: 1,251

Rep: Reputation: 45
the command
!!<return>

or you can cycle through your previous commands with the up arrow ...

the !!<return> you could program into your .inputrc file so that pressing F3 will cause the command to be issued.

should look something like
"\e[[C": previous-history

(I think)
hth
jpbarto
 
Old 07-29-2003, 04:34 PM   #4
nxny
Member
 
Registered: May 2002
Location: AK - The last frontier.
Distribution: Red Hat 8.0, Slackware 8.1, Knoppix 3.7, Lunar 1.3, Sorcerer
Posts: 771

Rep: Reputation: 30
Whatever suits your style the best, but here's a suggestion.

Code:
alias r='fc -e - '
Now r<Enter> would repeat the last command. r man<Enter> would bring up the last command that starts with man etc..

Apart from the one above, I also use..

Code:
set -o vi
Now you can navigate up/down/edit commands by presing ESC followed by j,k etc. Seach using ESC / etc.. Recommended only if you're a vi freak.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Question About a Command? carlosinfl Linux - General 4 10-28-2005 01:51 PM
Command question satimis Linux - Newbie 2 11-24-2004 09:59 AM
Command question satimis Linux - General 8 06-23-2004 03:43 AM
cp command question satimis Linux - Newbie 1 09-13-2003 09:31 PM
Command Question gauge73 Linux - Newbie 2 02-13-2003 09:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:42 PM.

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