Add several aliases
This commit is contained in:
parent
250c75ce56
commit
dd5c929439
1 changed files with 18 additions and 11 deletions
23
.bashrc
23
.bashrc
|
@ -7,8 +7,7 @@ usern=$(whoami)
|
||||||
function prompt {
|
function prompt {
|
||||||
ctime=$(date +%T)
|
ctime=$(date +%T)
|
||||||
prmpt="[${PWD}][${ctime}]"
|
prmpt="[${PWD}][${ctime}]"
|
||||||
cols=$(tput cols)
|
let FILLS=${COLUMNS}-${#prmpt}
|
||||||
let FILLS=${cols}-${#prmpt}
|
|
||||||
LINE=""
|
LINE=""
|
||||||
|
|
||||||
if [[ "$PWD" =~ "/home/$usern" ]]; then
|
if [[ "$PWD" =~ "/home/$usern" ]]; then
|
||||||
|
@ -34,19 +33,27 @@ PROMPT_COMMAND=prompt
|
||||||
# [----------------------------------------------------------------------------]
|
# [----------------------------------------------------------------------------]
|
||||||
# [----------------------------- ALIAS ---------------------------------------]
|
# [----------------------------- ALIAS ---------------------------------------]
|
||||||
# [----------------------------------------------------------------------------]
|
# [----------------------------------------------------------------------------]
|
||||||
|
|
||||||
# Common parameters
|
# Common parameters
|
||||||
if [ "$OSTYPE" == "linux-gnu" ]; then
|
|
||||||
alias ls='ls -v --color=auto'
|
alias ls='ls -v --color=auto'
|
||||||
alias ll='ls -lavh'
|
alias ll='ls -lavh'
|
||||||
alias grep='grep --color'
|
alias grep='grep --color'
|
||||||
else
|
|
||||||
alias ls='ls'
|
|
||||||
alias ll='ls -la'
|
|
||||||
alias grep='grep'
|
|
||||||
fi
|
|
||||||
|
|
||||||
alias sudo='sudo env PATH=$PATH'
|
alias sudo='sudo env PATH=$PATH'
|
||||||
|
|
||||||
|
alias ..='cd ..'
|
||||||
|
alias ...='cd ../..'
|
||||||
|
alias ....='cd ../../..'
|
||||||
|
|
||||||
|
# for git
|
||||||
|
alias get='git'
|
||||||
|
alias ga='git add'
|
||||||
|
alias gaa='git add .'
|
||||||
|
alias gs='git status'
|
||||||
|
alias gl='git log'
|
||||||
|
alias gcm='git commit -m'
|
||||||
|
alias gcf='git commit -F'
|
||||||
|
|
||||||
# [----------------------------------------------------------------------------]
|
# [----------------------------------------------------------------------------]
|
||||||
# [------------------------------ OTHER ---------------------------------------]
|
# [------------------------------ OTHER ---------------------------------------]
|
||||||
# [----------------------------------------------------------------------------]
|
# [----------------------------------------------------------------------------]
|
||||||
|
|
Loading…
Reference in a new issue