The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

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 09:25 AM
Command history in AIX priya_v111 Shell Programming and Scripting 2 09-18-2006 11:48 AM
History command akash_wagh Filesystems, Disks and Memory 0 08-31-2005 02:54 AM
command history vikasdeshmukh UNIX for Dummies Questions & Answers 3 11-14-2001 02:37 AM
History Command jack UNIX for Dummies Questions & Answers 2 08-01-2001 10:01 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 12-07-2003
a25khan's Avatar
Registered User
 

Join Date: Dec 2003
Location: My home :D
Posts: 35
Question Command history

Hello everyone,
I am aware about the history command we use in bash. Just had a question regarding the history of commands. Is there any way i can limit my commands to be remembered or is there any way to delete the commands used by myself? Thank you
Forum Sponsor
  #2  
Old 12-07-2003
google's Avatar
Moderator
 

Join Date: Jul 2002
Location: Atlanta
Posts: 740
There is a file in your home directory called .sh_history. To clear your history, just empty this file

From your home directory:

echo "" > .sh_history

You can also limit the size of your history file (in KSH) by setting the HISTFILE variable. See this thread
  #3  
Old 12-07-2003
Registered User
 

Join Date: Nov 2003
Location: HK
Posts: 53
To limit the history file in last 100 commands. Put the follows in your profile.
export HISTSIZE=100
__________________
tikual :)
  #4  
Old 12-07-2003
Registered User
 

Join Date: Jul 2002
Location: new york
Posts: 1,025
also you can dump your cammand history to stdout with the
'history'
command.
  #5  
Old 12-08-2003
a25khan's Avatar
Registered User
 

Join Date: Dec 2003
Location: My home :D
Posts: 35
Lightbulb

Hello everyone,
first of all user google: echo "" > .sh_history
i tried your suggested command and yes it does overwrite the .sh_history file with a line. But when i use the command history, it still shows me all of my commands!!! I want to delete the history of commands. Can you suggest something on that?

Second of all user tikul: export HISTSIZE=100
yes i wrote that in my .profile file but i still get 500+ commands! Can you comment on that?

And finally Mr. Hedensk
you asked me to dump my command history with 'history' command. It didn't work as expected. What exactly should i do here?

Now this is very likely possible that i might have misunderstood you all and didn't do it as it is supposed to be done. But can you all please try and point out my mistake or a possible explanation for it . Thank you all and have a good one
  #6  
Old 12-08-2003
Registered User
 

Join Date: Jul 2002
Location: new york
Posts: 1,025
well what i ment by 'dump' was that it would output its contents to your screen. not empty the history.
  #7  
Old 12-08-2003
a25khan's Avatar
Registered User
 

Join Date: Dec 2003
Location: My home :D
Posts: 35
O ok i got that norsk Thanks
Google The UNIX and Linux Forums
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 08:19 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0