Since my wetware is getting sluggish to remember past CLI commands accurately, and Linux keeps only the last couple of thousand commands without removing redundances, I was thinking about the possibility of a package existing that efficiently keeps a lean record of such commands.
So, in effect such a package should look into .bash_history and similarly used files to save a list of all used commands without unnecessary repetitions.
Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
[SOLVED] Used CLI commands saving for future reference.
[SOLVED] Used CLI commands saving for future reference.
Last edited by edbarx on 2017-11-08 17:42, edited 1 time in total.
Debian == { > 30, 000 packages }; Debian != systemd
The worst infection of all, is a false sense of security!
It is hard to get away from CLI tools.
The worst infection of all, is a false sense of security!
It is hard to get away from CLI tools.
Re: Used CLI commands saving for future reference.
bash history settings are adjustable.edbarx wrote:Linux keeps only the last couple of thousand commands without removing redundances
my history is HUGE, and it makes me happy
relevant settings in .bashrc:
Code: Select all
HISTSIZE=50000
HISTFILESIZE=2000000
# unix.stackexchange.com/a/18443
# history: erase duplicates...
HISTCONTROL=ignoredups:erasedups
shopt -s histappend
Re: Used CLI commands saving for future reference.
Thanks for the prompt reply.
Do I need to modify some other file so that commands run as root are also preserved without redundant duplicates?
EDIT:
Under /root, .bashrc is all commented out which should mean, I assume, the other .bashrc is used also for root. However, I may be wrong and that is why I am posting again.
Do I need to modify some other file so that commands run as root are also preserved without redundant duplicates?
EDIT:
Under /root, .bashrc is all commented out which should mean, I assume, the other .bashrc is used also for root. However, I may be wrong and that is why I am posting again.
Debian == { > 30, 000 packages }; Debian != systemd
The worst infection of all, is a false sense of security!
It is hard to get away from CLI tools.
The worst infection of all, is a false sense of security!
It is hard to get away from CLI tools.
Re: Used CLI commands saving for future reference.
That's an interesting idea. In my case it won't show much because I have been in the habit of cleaning out
bash history fairly regularly. I started that when I discovered my root password in it. No, that's not a failure of Debian; it is the result of my absent-minded brain going off on a tangent.
bash history fairly regularly. I started that when I discovered my root password in it. No, that's not a failure of Debian; it is the result of my absent-minded brain going off on a tangent.
Re: Used CLI commands saving for future reference.
You don't need to delete .bash_history to remove that password from the list of commands. When I make the silly mistake of typing my root password as if it were a command and it ends in the .bash_history file, I open the latter with nano, remove the password from the list and save the edited file. For the password to appear in .bash_history, you may need to close all bash terminals, but I don't remember this is actually necessary. Again, I blame my rusty wetware!Bulkley wrote: I started that when I discovered my root password in it.
Debian == { > 30, 000 packages }; Debian != systemd
The worst infection of all, is a false sense of security!
It is hard to get away from CLI tools.
The worst infection of all, is a false sense of security!
It is hard to get away from CLI tools.
Re: Used CLI commands saving for future reference.
funny you should mention that, because i actually lied: the above was taken from /etc/bash.bashrc which is parsed for all users.edbarx wrote:Do I need to modify some other file so that commands run as root are also preserved without redundant duplicates?
still you'd have a different history file for root i guess.
Re: Used CLI commands saving for future reference.
I don't believe you lied, I'd guess you didn't consider your answer carefully enough before posting, maybe you were in a hurry but I wouldn't want to think you lied.debiman wrote:funny you should mention that, because i actually lied: the above was taken from /etc/bash.bashrc which is parsed for all users.
still you'd have a different history file for root i guess.
Does that mean that there has been a change in Stretch, because those, HIST* lines are not in /etc/bash.bashrc in my Jessie installation or is it because that is where you put the lines in your system?
A system administrator on a multi-seat system may or may not want that to be global. They may want to be able to examine all the commands and fumbling that a user may do as an assessment, even dups, thus they may decide to do it on a per user basis in the user's home .bashrc.
Yes, I too would expect the superuser's bash_history and .bashrc to be in /root, the superuser's home.
Re: Used CLI commands saving for future reference.
no, i did it quite on purpose because i didn't want to bother you with confusing details.Thorny wrote:I don't believe you lied, I'd guess you didn't consider your answer carefully enough before posting, maybe you were in a hurry but I wouldn't want to think you lied.
i put them there.Does that mean that there has been a change in Stretch, because those, HIST* lines are not in /etc/bash.bashrc in my Jessie installation or is it because that is where you put the lines in your system?