The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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
History command akash_wagh Filesystems, Disks and Memory 2 01-22-2009 12:51 PM
Help with the History command cleansing_flame UNIX for Dummies Questions & Answers 2 02-04-2008 12:25 PM
Command history in AIX priya_v111 Shell Programming and Scripting 2 09-18-2006 02:48 PM
command history vikasdeshmukh UNIX for Dummies Questions & Answers 3 11-14-2001 05:37 AM
History Command jack UNIX for Dummies Questions & Answers 2 08-01-2001 01:01 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rating: Thread Rating: 1 votes, 5.00 average. Display Modes
  #1 (permalink)  
Old 12-07-2003
a25khan's Avatar
a25khan a25khan is offline
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
  #2 (permalink)  
Old 12-07-2003
google's Avatar
google google is offline Forum Advisor  
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 (permalink)  
Old 12-07-2003
tikual tikual is offline
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
  #4 (permalink)  
Old 12-07-2003
norsk hedensk norsk hedensk is offline Forum Advisor  
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 (permalink)  
Old 12-09-2003
a25khan's Avatar
a25khan a25khan is offline
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 (permalink)  
Old 12-09-2003
norsk hedensk norsk hedensk is offline Forum Advisor  
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 (permalink)  
Old 12-09-2003
a25khan's Avatar
a25khan a25khan is offline
Registered User
  
 

Join Date: Dec 2003
Location: My home :D
Posts: 35
O ok i got that norsk Thanks
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 04:45 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