Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # .bashrc
- # User specific aliases and functions
- alias k='kubectl'
- alias rm='rm -i'
- alias cp='cp -i'
- alias mv='mv -i'
- alias hgrep='history|grep'
- # Source global definitions
- if [ -f /etc/bashrc ]; then
- . /etc/bashrc
- fi
- # Use vi editing on the command line by pressing ESC
- #set -o vi on
- if [ -x /usr/bin/kubectl -o -x /usr/local/bin/kubectl ]
- then
- source <(kubectl completion bash)
- fi
- function backup() {
- if [ -n "$1" ]
- then
- source=$1
- else
- echo 'Provide a path to a file or directory to backup'
- echo 'Usage: backup /path/to/file'
- echo 'Result is file path extended with date/time stamp'
- exit 1
- fi
- stamp=$( date +%Y%m%d-%H%M%S )
- if [ -d "$source" ]
- then
- cp -a $source $source.$stamp
- else
- cp $source $source.$stamp
- fi
- }
- function mkcd() {
- mkdir -p $1 && cd $1
- }
- df() {
- /usr/bin/df -h $* | grep -vE "docker|tmpfs"
- }
- function lfget() {
- pw=$(cat $HOME/.LFTpw)
- wget --user=LFtraining --password=$pw $1
- }
Add Comment
Please, Sign In to add comment