write a fancy bashrc

This commit is contained in:
Christoph J. Scherr 2025-03-01 15:10:41 +01:00
parent eba887a605
commit d312e63deb
Signed by: PlexSheep
GPG key ID: 9EB784BB202BB7BB

35
.bashrc
View file

@ -1,3 +1,5 @@
. /etc/bash.bashrc
alias l="ls -lah"
alias la="ls -ah"
alias ls="ls -h"
@ -9,4 +11,35 @@ alias psgrep="ps axu | grep"
alias isotime='date +"%Y-%m-%dT%H:%M:%S%z"'
alias isodate='date +%Y-%m-%dT%H:%M:%S%z'
alias gls=/bin/ls
export HISTFILE=/dev/null
alias isotime='date +"%Y-%m-%dT%H:%M:%S%z"'
alias isodate='date +%Y-%m-%dT%H:%M:%S%z'
alias datefmt='date $DATEFMT'
alias gotemp="cd $(mktemp -d)"
alias fd=fdfind
alias bak=backup
export PS1='\[\e[1;31m\]\u@\h \[\e[1;36m\]\w\[\e[1;37m\] \$ \[\e[0m\]'
export DEBEMAIL="software@cscherr.de"
export DEBFULLNAME="Christoph J. Scherr"
export DEBIDENTITY="$DEBFULLNAME <$DEBEMAIL>"
export TIMEFMT=$'\nreal\t%E\nuser\t%U\nsys\t%S\ncpu\t%P'
export DATEFMT='+%a %Y-%m-%d %X'
export EDITOR=$(which vim)
export VISUAL=$(which vim)
function random() {
if [ $# -ne 1 ] || ! [[ $1 =~ ^[0-9]+$ ]] || [ $1 -lt 1 ]; then
echo "Error: Please provide one positive integer argument" >&2
return 1
fi
echo $(( (RANDOM % $1) + 1 ))
}
function largefiles () { exec 2>/dev/null; du -ah "$@" | grep -P "^\d+(G|T|P|E)\s" }
function midfiles () { exec 2>/dev/null; du -ah "$@" | grep -P "^\d+(M|G|T|P|E)\s" }
function smallfiles () { exec 2>/dev/null; du -ah "$@" | grep -P "^\d+(B|K)\s" }
function newpass() {
LC_ALL=C tr -dc '[:alnum:]' < /dev/urandom | head -c${1:-40}
}
# set vi mode
set -o vi