Last active
August 16, 2022 10:33
-
-
Save tayyebi/5e03f83dff1b897a51e530748d74e872 to your computer and use it in GitHub Desktop.
Log commands history of multiple users in same time with details
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add to .bashrc | |
# Avoid duplicates | |
export HISTCONTROL=ignoredups:erasedups | |
# When the shell exits, append to the history file instead of overwriting it | |
shopt -s histappend | |
# After each command, append to the history file and reread it | |
export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}history -a; history -c; history -r" | |
# History Datetime | |
export HISTTIMEFORMAT='%F %T ' | |
# Add a cute dog to my temrinal | |
PS1="🦮 $ " | |
# Be polite! | |
alias please="sudo" | |
# Show progress bar with unzip (based on stackoverflow#909918); usage: punzip file.zip | |
function plunzip { | |
for f in $(unzip -Z -1 $1 | grep -v '/$'); | |
do | |
[[ "$f" =~ "/" ]] && mkdir -p ${f%/*} | |
echo "Extracting $f" | |
unzip -o -c $1 $f \ | |
| pv -s $(unzip -Z $1 $f | awk '{print $4}') \ | |
> $f | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Then simply run
source .bashrc
to instantly see the changes.