You are not logged in.

#1 2021-09-24 15:02:05

pn
Member
Registered: 2020-01-28
Posts: 39

Default commands log retention

Considering that, for troubleshooting, history of commands performed are way more useful than other logs. Why a lot of logs retentions are way more long (for example `journalctl` can store gigabytes of logs per default) than user commands retention (it's limited to 500 commands, considering that commands are generally short, the logs are maybe few kilobytes long)?

I suggest for Arch Linux to keep commands history at a minimum of 100 MB per default

(and here I only talk about troubleshooting, and not about the fact that sometimes you spend afternoons to understand the concept of a program to perform the perfect command and that you lose all your work in one week because you performed 500 commands after that and wiped it from history)

Offline

#2 2021-09-24 15:06:05

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,463

Re: Default commands log retention

This is all up to your shell. Arch tends to accept the upstream defaults for things like this.

Offline

#3 2021-09-24 15:08:49

schard
Member
From: Hannover
Registered: 2016-05-06
Posts: 1,932
Website

Re: Default commands log retention

Are you referring to .bash_history?
If so, you can tweak its maximum size via $HISTSIZE. See also: https://www.shellhacks.com/tune-command … tory-bash/

Offline

#4 2021-09-24 15:17:47

pn
Member
Registered: 2020-01-28
Posts: 39

Re: Default commands log retention

Scimmia wrote:

This is all up to your shell. Arch tends to accept the upstream defaults for things like this.

I talk for the default shell that Arch takes in basic installation

So the problem should be addressed upstream? Or Arch community can decide to modify this parameter for Arch package?

schard wrote:

Are you referring to .bash_history?
If so, you can tweak its maximum size via $HISTSIZE. See also: https://www.shellhacks.com/tune-command … tory-bash/

I talk about default behaviour here

Last edited by pn (2021-09-24 15:18:22)

Offline

#5 2021-09-24 16:12:20

seth
Member
Registered: 2012-09-03
Posts: 49,981

Re: Default commands log retention

I talk for the default shell that Arch takes in basic installation

There's no "default" with archlinux.
You choose the shell. You configure it as you like it. That's the default.

I suggest for Arch Linux to keep commands history at a minimum of 100 MB per default

So the problem should be addressed upstream? Or Arch community can decide to modify this parameter for Arch package?

What "problem"? You not finding $HISTSIZE? …
If you want to change the bash defaults, see https://savannah.gnu.org/support/?group=bash
But I guess that you'll have a hard time finding a second person on the planet who thinks that 100MB shell history, let alone for "troubleshooting" / TAE, that needs to be loaded w/ every interactive shell is anywhere *near* a sane idea.

sometimes you spend afternoons to understand the concept of a program to perform the perfect command and that you lose all your work in one week because you performed 500 commands after that and wiped it from history

Fwwi, for bash/zsh you can keep your TAE out of the history by prepending it w/ a blank: " awk 'i really do not understand how any of this works'"

Offline

#6 2021-09-24 16:45:28

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,444
Website

Re: Default commands log retention

There's also can be a distinction between long-term storage of your shell history and what is in active "history" or loaded in every interactive session and ready for use via history commands or the up arrow.  It's perfectly reasonable and quite feasible to keep a long term record of shell commands stored on disk while still keeping a small loaded / active history.  I'm certainly never going to hit the up arrow more than a couple times to retrieve an old command - so I'd really not need more than a few lines in the active history.  Anytime I would want to 'grep' older history for a given command, it'd be just as easy (if not easier) to grep a log file rather than using a shell builtin history tool.

But all this is fairly tangential here - there are countless options on how you configure your shell, but it is up to you to do so.

Last edited by Trilby (2021-09-24 16:46:03)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

Board footer

Powered by FluxBB