Skip to content

Instantly share code, notes, and snippets.

@trajakovic
Created October 23, 2015 14:24
Show Gist options
  • Save trajakovic/38bae83c8eb3fc7ee6cf to your computer and use it in GitHub Desktop.
Save trajakovic/38bae83c8eb3fc7ee6cf to your computer and use it in GitHub Desktop.

Revisions

  1. trajakovic created this gist Oct 23, 2015.
    15 changes: 15 additions & 0 deletions unlimited_bash_history.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    #!/usr/bin/env bash

    func_check_for_root() {
    if [ ! $( id -u ) -eq 0 ]; then
    echo "ERROR: $0 Must be run as root, Script terminating" ;exit 7
    fi
    }
    func_check_for_root

    cat <<_EOF_ | sudo tee /etc/profile.d/bash_unlimited_history.sh
    HISTFILESIZE=1000000000
    HISTSIZE=1000000
    HISTTIMEFORMAT='%F %T '
    export HISTFILESIZE HISTSIZE HISTTIMEFORMAT
    _EOF_