My OpenWrt Study notes (18): Linux easy to develop command alias
Learning Linux commands is the basis of Linux, I believe many people n years ago know this command, learning the amount of time also used it, but over the course of this command will fade out of our vision! In the actual work sometimes forget it, the main reason is that the use of the actual application of the word is not enough!
Linux command: alias
function Description: Sets the alias of the directive.
syntax: alias[ ]=[ directive name "
Supplemental Note: Users can take advantage of the alias alias
alias ~/.BASHRC
Alias in the actual work of the individual, the most is to enter the comparison plant Linux directories, such as compiling OpenWrt the directory ( d/home/linux/svn0825/develop/openwrt-3.10.14 ), relatively long, if by CD the first level of entry is too wronged Linux , what do you say?
Set aliases, modify [email protected]:~/svn0825/develop/openwrt-3.10.14$ vi ~/.BASHRC file |
# Enable programmable completion features (you don ' t need to enable # This, if it ' s already enabled IN/ETC/BASH.BASHRC And/etc/profile # SOURCES/ETC/BASH.BASHRC). If [-f/etc/bash_completion] &&! Shopt-oq POSIX; Then . /etc/bash_completion Fi Alias op7688= ' cd/home/linux/svn0825/develop/openwrt-3.10.14 ' |
Let the settings op7688 effective |
[Email protected]:~$ Source ~/.BASHRC |
View alias settings |
[Email protected]:~$ alias 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$//' \ ') ' Alias egrep= ' Egrep--color=auto ' Alias fgrep= ' Fgrep--color=auto ' Alias grep= ' grep--color=auto ' Alias l= ' LS-CF ' Alias La= ' Ls-a ' Alias Ll= ' Ls-alf ' Alias ls= ' ls--color=auto ' Alias op7688= ' cd/home/linux/svn0825/develop/openwrt-3.10.14 ' |
Test op7688 aliases |
[Email protected]:~$ pwd /home/linux [Email protected]:~$ op7688 [Email protected]:~/svn0825/develop/openwrt-3.10.14$ pwd /home/linux/svn0825/develop/openwrt-3.10.14 |
At this point, in any directory can be arbitrarily re-enter the OpenWrt development directory, alias of the spirit to understand OH.
I hope we can teach people to fish, ^--^
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
My OpenWrt Study notes (18): Linux easy to develop command alias