https://github.com/mohamedelashri/shell-timestamp
timestemping commands in shell history
https://github.com/mohamedelashri/shell-timestamp
bash bashrc history-management shell zsh zshrc
Last synced: 3 months ago
JSON representation
timestemping commands in shell history
- Host: GitHub
- URL: https://github.com/mohamedelashri/shell-timestamp
- Owner: MohamedElashri
- Created: 2025-06-06T17:27:03.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-06T17:30:52.000Z (about 1 year ago)
- Last Synced: 2025-06-06T18:33:05.520Z (about 1 year ago)
- Topics: bash, bashrc, history-management, shell, zsh, zshrc
- Language: Shell
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Shell History Timestamper
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.
## What It Does
- 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.
## Usage
1. Download and make the script executable:
```sh
chmod +x shell-timestamp.sh
```
2. To **enable** timestamped history, run:
```sh
./shell-timestamp.sh install
```
3. To **disable** and fully remove the configuration, run:
```sh
./shell-timestamp.sh uninstall
```
4. After installing or uninstalling, **restart your shell** or run:
```sh
source ~/.bashrc
```
or
```sh
source ~/.zshrc
```
to apply changes immediately.
## Notes
- 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.