-   Linux - Newbie (
-   -   Disabling console commands? (

Kage 02-09-2002 10:39 AM

Disabling console commands?
Anybody know how to disable the feature in linux that keeps track of all the commands youve typed? I really want to just empty it and start over again but I figure theyll come a time when I dont want it on so I better learn everything I can about controlling this.

acid_kewpie 02-09-2002 10:50 AM

well, the commands are kept in ~/.bash_history, so you can just delete that to start from new. i can't see a nice way to stop it loggin permanently, but you should be able to add a line (rm ~/.bash_history) to /etc/bashrc to erase the previous login's history upon starting new shell. this should be ok, as the file doesn't get written to untioli the shell is existed. you could also create a ~/.bash_history file in each user directory owned by root, and not writable by others, so the data couldn't be saved. but i'm not sure they are really that competent a solution, they would do the trick tho

isajera 02-09-2002 12:06 PM

hmmm... that's a feature that's going to be on pretty much every shell... most people consider it to be insanely useful. the only thing i could think of would be to set the env variable HISTORY to zero.

in your .login, put this line:

export HISTORY

i think that will work. if you get any errors, post back here.

Malicious 02-09-2002 12:17 PM

If you are using bash, you can do one of two things.

export HISTFILE=/xxx/xxx where /xxx/xxx is unwritable by the login user. The file won't be created.

unset HISTFILE - the file will still be created (as a temporary file) and will be deleted when the shell exits.

See man bash and search for HISTORY.

acid_kewpie 02-09-2002 12:38 PM

do the shabby thing
bleurgh, i quit...

for a minute or so. i meant to see if somethign like that was there but i forgot...:rolleyes:

ah i love exposing myself as a dumbass!

All times are GMT -5. The time now is 03:04 AM.