My OpenWrt Study notes (18): Linux easy to develop command alias

Source: Internet
Author: User
Tags aliases egrep

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.