write a fancy bashrc
This commit is contained in:
parent
eba887a605
commit
d312e63deb
1 changed files with 34 additions and 1 deletions
35
.bashrc
35
.bashrc
|
@ -1,3 +1,5 @@
|
||||||
|
. /etc/bash.bashrc
|
||||||
|
|
||||||
alias l="ls -lah"
|
alias l="ls -lah"
|
||||||
alias la="ls -ah"
|
alias la="ls -ah"
|
||||||
alias ls="ls -h"
|
alias ls="ls -h"
|
||||||
|
@ -9,4 +11,35 @@ alias psgrep="ps axu | grep"
|
||||||
alias isotime='date +"%Y-%m-%dT%H:%M:%S%z"'
|
alias isotime='date +"%Y-%m-%dT%H:%M:%S%z"'
|
||||||
alias isodate='date +%Y-%m-%dT%H:%M:%S%z'
|
alias isodate='date +%Y-%m-%dT%H:%M:%S%z'
|
||||||
alias gls=/bin/ls
|
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
|
||||||
|
|
Loading…
Add table
Reference in a new issue