LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-14-2004, 04:31 PM   #1
GUIPenguin
Member
 
Registered: Aug 2004
Location: Maine
Distribution: Gentoo Linux
Posts: 239

Rep: Reputation: 30
Always clear last command


You know when you open a shell and click the up or down arrow it displays the last command you typed into a terminal

Is there a way or a command that could be written to clear this

Thanks, John!
 
Old 09-14-2004, 04:39 PM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
If you are talking about a bash shell set the HISTSIZE to 0 (zero).

Can be found:

globaly in /etc/profile (or /etc/bashrc)
local in ~/.profile

Hope this helps.
 
Old 09-14-2004, 04:40 PM   #3
MartinN
Member
 
Registered: Nov 2003
Location: Ronneby, Sweden
Posts: 555

Rep: Reputation: 30
Sure,
history -c
if you're using bash (which is pretty much default these days).

Martin
 
Old 09-14-2004, 04:45 PM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Well it migth be that I was a bit too enthusiastic

My option prevents the history entirely, the history -c options clears what's there and after that commands are added to the history again.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
clear history "last" command nistelrooy Linux - Newbie 10 11-03-2010 12:09 PM
how do i replace the clear "clear screen" with the cls command thefedexguy SUSE / openSUSE 2 12-02-2005 05:02 PM
history clear command suguname Linux - Newbie 5 03-05-2005 09:32 AM
Command to clear RAM? flamesrock Linux - Software 9 11-22-2004 06:41 PM
help clear this up synapse Slackware 2 10-05-2004 09:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:39 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
Open Source Consulting | Domain Registration