Linux下常用别名设置
.my-profile
alias ..="cd .."
alias which="type -path"
alias where="type -all"
alias ll="ls -lh --color=auto"
alias l="ls -a --color=auto"
alias mv="mv -i"
alias cp="cp -i"
alias la="ls -la --color=auto"
alias ls="ls --color=auto"
alias s="cd .."
alias ss="cd ../.."
alias sss="cd ../../.."
alias ssss="cd ../../../.."
alias p="cd -"
alias d="ls"
alias h="cd ~"
alias cl="clear"
alias sm="ls | xargs svn st | grep '^[^\?I].*'"
alias st="svn diff --diff-cmd=tkdiff"
xtouch()
{
local _f=$1
if [ "$_f" ] && [ ! -f "$_f" ] && touch $_f && chmod u+x $_f ; then
suffix=`echo $_f | sed 's%.*\(sh\|py\)$%\1%'`
if [ "$suffix" == 'py' ] ; then
echo -e "#!/usr/bin/python" > $_f
else
echo -e "#!/bin/bash" > $_f
fi
fi
}
fxml()
{
local iFile=$1
if [ "$iFile" ] && [ -f "$iFile" ] ; then
xmllint --format $iFile --output ~$iFile && cat ~$iFile > $iFile
[ -f "~$iFile" ] && rm ~$iFile
fi
}
findf()
{
[ "$1" ] && find ./ -name $1 -type f
}
vfind()
{
findf $1 | xargs gvim
}
在.bashrc或者/etc/profile中添加 source .my-profile
, 使生效。
网友评论