Fedora Linux Support Community & Resources Center
  #1  
Old 28th October 2010, 10:14 AM
cinsevarg Offline
Registered User
 
Join Date: Oct 2010
Posts: 38
linuxchrome
CLI :: Intrigue and Semantics :: Command Line Shortkeys

When in a terminal, and I press up on the direction keys it remembers the previous command I sent. Does this action have a specific name, or community name?

Also, when I am logged in as 'user' the terminal remembers that user's last command, and then if I switch over to root it remembers my root's last command, not the user's. This makes me think that it is not some on the fly temporary recall, but that this information is actually stored somewhere.
Where is this file? How do I view its content?
Reply With Quote
  #2  
Old 28th October 2010, 10:26 AM
glennzo Offline
Un-Retired Administrator
 
Join Date: Mar 2004
Location: Salem, Mass USA
Age: 57
Posts: 14,713
linuxfedorafirefox
Re: CLI :: Intrigue and Semantics :: Command Line Shortkeys

Quote:
Originally Posted by cinsevarg View Post
When in a terminal, and I press up on the direction keys it remembers the previous command I sent. Does this action have a specific name, or community name?
Also, when I am logged in as 'user' the terminal remembers that user's last command, and then if I switch over to root it remembers my root's last command, not the user's. This makes me think that it is not some on the fly temporary recall, but that this information is actually stored somewhere.
Where is this file? How do I view its content?
It is the command history. Type man history, info history, history.
__________________
Glenn
The Bassinator © ®

[SIGPIC][/SIGPIC]
Laptop: Toshiba Satellite / Intel Core 2 Duo 1.73 GHz / 2GB / 160GB / Intel Mobile 945GM/GMS/GME/943/940GML Integrated Graphics
Desktop: BioStar MCP6PB M2+ / AMD Phenom 9750 Quad Core / 4GB / 1TB SATA / 500GB SATA / EVGA GeForce 8400 GS 1GB
Reply With Quote
  #3  
Old 28th October 2010, 11:30 AM
smr54 Online
Registered User
 
Join Date: Jan 2010
Posts: 5,514
linuxopera
Re: CLI :: Intrigue and Semantics :: Command Line Shortkeys

Usually kept in the file $HOME/.bash_history (with $HOME being a variable, representing your history.)

Looking at CentOS, man history just gives a list of builtin commands--info history seems a lot of reading, but probably worthwhile.

One common use of it might be to save the bother of repeatedly typing something. Suppose I have a long rsync command, like rsync this option abcd /long_destination_string. I can then do something like

history |grep rsync

And see something like

580 rsync <blah blah>
600 rysnc <blah blah>

In other words, all the times I've used rsync that remain in history.

Now, if I type

!600

It will rerun the command.
Reply With Quote
  #4  
Old 28th October 2010, 11:36 AM
cinsevarg Offline
Registered User
 
Join Date: Oct 2010
Posts: 38
linuxchrome
Figured

sm54, excellent info. Thanks a lot. The grep'! abilities are maddness.
Reply With Quote
Reply

Tags
cli, command, intrigue, line, semantics, shortkeys

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
DSO Link Semantics: apply /lib64/libpthread.so.0 to linker command line Shunyata Programming & Packaging 1 28th June 2010 11:33 PM


Current GMT-time: 03:55 (Saturday, 20-09-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat