The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Operating Systems > SUN Solaris
.
google unix.com



SUN Solaris The Solaris Operating System, usually known simply as Solaris, is a free Unix-based operating system introduced by Sun Microsystems .

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 12:25 PM
Creating a command history feature in a simple UNIX shell using C -=Cn=- Shell Programming and Scripting 2 11-13-2007 01:04 AM
Command history in AIX priya_v111 Shell Programming and Scripting 2 09-18-2006 03:48 PM
how unix stores command history Sabari Nath S UNIX for Advanced & Expert Users 3 09-10-2005 01:52 AM
command history vikasdeshmukh UNIX for Dummies Questions & Answers 3 11-14-2001 05:37 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-28-2007
mm00123 mm00123 is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 60
Question unix command history

is there any way to determine the last command entered on a unix machine???

Thanx
  #2 (permalink)  
Old 11-28-2007
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,958
Hope you are using ksh ?

use,

Esc + k

combination
  #3 (permalink)  
Old 11-28-2007
Lakris Lakris is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 246
The command line history is specific for a user and for a shell. This is basically how bash works:

When You start a shell (for example at login or when starting an xterm) a file with recorded command line history is read from a file called $HOME/.bash_history. If You do something in this shell and then start another one, the new one will not yet be aware of what has been done in the other one, that is, they will have the same "history" to start with. When You close the first shell (log out or close an xterm), its "additions" is added to the .bash_history. When You close the second shell, IT'S additions will be added to the file. Next time You start a shell, You will have both "additions" available in history.

So, You can take a look in the history file.
Most shells have the history command which will give You a list of historical commands. This can be big or small, and handled differently on different shells. Size, duplicates and other things can be configured.

Some shells support using up and down arrow keys to browse through the the current shells history, which then can be edited and reused.

A lot could be said about this. Look in the bash man page and search for HISTORY.

But maybe You meant what command or program in general has been executed? Then one must rely on whether the program has logged anything with time stamp, in for example some of the /var/log/ files or its own log files.

Or search the web!

/Lakris
  #4 (permalink)  
Old 12-03-2007
hemantsolaris's Avatar
hemantsolaris hemantsolaris is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 1
Post history

#history is a command to see the previously used commands list.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:44 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0