This utility script enables or disables timestamped command history for Bash and Zsh shells. It does so by managing a single .history_config file in your home directory and ensuring your shell configuration files (.bashrc and .zshrc) source it.
- Ensures every command you run in Bash or Zsh is saved with an execution timestamp.
- Keeps your shell configuration clean by isolating all related settings in
.history_config. - Makes activation and removal fully reversible and idempotent.
-
Download and make the script executable:
chmod +x shell-timestamp.sh
-
To enable timestamped history, run:
./shell-timestamp.sh install
-
To disable and fully remove the configuration, run:
./shell-timestamp.sh uninstall
-
After installing or uninstalling, restart your shell or run:
source ~/.bashrc
or
source ~/.zshrc
to apply changes immediately.
- The script will not overwrite your existing shell configuration or history settings; it only adds or removes a dedicated sourcing block and config file.
- Existing history files are not modified; only new history entries will include timestamps after installation.