LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-05-2004, 07:26 PM   #1
brunnopessoa
Member
 
Registered: Nov 2003
Location: Rio de Janeiro, Brazil
Distribution: Fedora
Posts: 67

Rep: Reputation: 15
The !! command


Hi everyone! I am just figuring out what is the function of the command !! in the bash. It seems it just puts in the command line the command executed just before (in other words, the last executed command), right? What would be its usage if I can do this by just pressing the "up arrow" key?

Tks!

Last edited by brunnopessoa; 11-05-2004 at 08:01 PM.
 
Old 11-05-2004, 07:49 PM   #2
ror
Member
 
Registered: May 2004
Distribution: Ubuntu
Posts: 583

Rep: Reputation: 33
not all terminals arrow keys work (and especially true for somethings over SSH and stuff)

so, you get neat other solutions, this is also why vim/emacs have cursor moving keys.
 
Old 11-05-2004, 08:03 PM   #3
brunnopessoa
Member
 
Registered: Nov 2003
Location: Rio de Janeiro, Brazil
Distribution: Fedora
Posts: 67

Original Poster
Rep: Reputation: 15
Makes sense ror. Tks!

And you know it the !-2 command has the same function? And what about !-1, does it exist? What for?

Tks in advance.
 
Old 11-05-2004, 10:39 PM   #4
Poetics
Senior Member
 
Registered: Jun 2003
Location: California
Distribution: Slackware
Posts: 1,181

Rep: Reputation: 49
For -really- anal programmers it's also a shortcut if you have to run the same command a few times in a row; slightly smaller program size (depending on program) typing "!!" in rather than a long and complicated command.

Or ... well, who knows
 
Old 11-05-2004, 10:51 PM   #5
ror
Member
 
Registered: May 2004
Distribution: Ubuntu
Posts: 583

Rep: Reputation: 33
yeah it's scriptable unlike the up arrow
 
  


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
Is there a single command to list all hardware installed (command line)? davee Linux - Hardware 6 02-28-2009 07:19 PM
Require Linux/Perl equivalent command for windows Command alix123 Programming 7 08-19-2005 02:23 AM
Key stroke/command to shut down x and go into the command prompt screen? Fear58 Linux - General 1 07-14-2004 07:14 PM
Command to display whole filestructure hierarchy f/ command line? mjewell Linux - Newbie 10 01-19-2004 10:48 AM
Where is Command line utility for Cups and command tutorial mossy Linux - Software 8 01-16-2004 12:24 AM


All times are GMT -5. The time now is 05:48 AM.

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