45 lines
1.4 KiB
Bash
45 lines
1.4 KiB
Bash
. /etc/bash.bashrc
|
|
|
|
alias l="ls -lah"
|
|
alias la="ls -ah"
|
|
alias ls="ls -h"
|
|
alias ll="ls -lh"
|
|
alias grep="grep --color"
|
|
alias egrep="grep -E"
|
|
alias lgrep="find | grep"
|
|
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
|
|
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
|