sh 的.bashrc

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh 的.bashrc相关的知识,希望对你有一定的参考价值。

alias thewire='ssh root@138.68.252.167'

#grab server info

if [ -f /usr/bin/screenfetch  ]; then screenfetch; fi
# If not running interactively, don't do anything
[ -z "$PS1"  ] && return

HISTCONTROL=ignoreboth

# append to the history file, don't overwrite it
shopt -s histappend

HISTSIZE=1000
HISTFILESIZE=2000

shopt -s checkwinsize

# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe  ] && eval "$(SHELL=/bin/sh lesspipe)"

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}"  ] && [ -r /etc/debian_chroot  ]; then
        debian_chroot=$(cat /etc/debian_chroot)
    fi

# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
      xterm-color) color_prompt=yes;;
esac

force_color_prompt=yes
if [ -n "$force_color_prompt"  ]; then
     if [ -x /usr/bin/tput  ] && tput setaf 1 >&/dev/null; then
     # We have color support; assume it's compliant with Ecma-48
     # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
     # a case would tend to support setf rather than setaf.)
        color_prompt=yes
          else
        color_prompt=
     fi
fi

# Get repo info
if [ "$color_prompt" = yes  ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;91m\]\u\[\033[01;37m\] at \[\033[01;33m\]\h\[\033[01;37m\]:\[\033[01;34m\]\w\[\033[00m\]$(__git_ps1 " \[\033[01;32m\][%s]")\[\033[00m\]\$ '
    PS2="> "
   else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi

unset color_prompt force_color_prompt

# If this is an xterm set the title to user@host:dir
case "$TERM" in
    xterm*|rxvt*)
    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
    ;;
   *)
    ;;
esac

# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors  ]; then
    test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
    alias ls='ls --color=auto'
    #alias dir='dir --color=auto'
    #alias vdir='vdir --color=auto'

    alias grep='grep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias egrep='egrep --color=auto'
fi

# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
alias alert='notify-send --urgency=low -i "$([ $? = 0  ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'

cd ~

alias bashrc='vim ~/.bashrc'
alias vimrc='vim ~/.vimrc'
alias tmux.conf='vim ~/.tmux.conf'
alias c='clear'
alias v='vim'
alias cmscript='cd /mnt/c/Users/mikes/scripts'
alias cmdownloads='cd /mnt/c/Users/mikes/scripts'
alias cmdocuments='cd /mnt/c/Users/mikes/scripts'

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

以上是关于sh 的.bashrc的主要内容,如果未能解决你的问题,请参考以下文章

sh 的.bashrc

sh 的.bashrc

sh 的.bashrc

sh 安装shskwmt的bashrc

sh ubuntu的默认.bashrc

sh 的.bashrc