Alias function varibales in Linux/gnu and MAC alias command detail

Source: Internet
Author: User
Tags goagent

In detail, in ancient classical Chinese is "spy suitors words", now become "detailed explanation" of the abbreviation.

Alias is the counterpart of Doskey in Ms-doc Cmds, which means "alias" or "pseudonym"

Alias is powerful in that it can be reduced to simple, hatchet, a little, the magic of decay, in short, high means lazy.

By default, all of the settings are in. BASHRC, but to summarize our usual changes, no more than alias something, add the PATH environment variable, or write a function of what function, so?

Write more, found. bashrc files are very long, very bad operation, so

We set the. BASHRC in three ways, respectively, to write the alias part (. bash_aliases), the Environment Variables section (. bash_variables), and the function section (. bash_functions)

Haha, this ya will give. BASHRC a lot of thin body, you can put the 3 of the corresponding line cut in the past, but the merit is not gaocheng, we also need to put these 3 files and. BASHRC link up Oh.

Add the following lines at the end of the. BASHRC

Green dots indicate the use of Include,bash

In Linux/gnu The default CLI configuration is in ~/.BASHRC, you can grep ' alias ' ~/.BASHRC to see what has been prepared for you beforehand.

>>> alias grep= ' grep--color=auto '

Alias La= ' Ls-a '

Alias Ll= ' Ls-alf '

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$//' \ ') '

...

See the law is alias name=content This, so we can imitate the other

I added later: (. bash_aliases)

# Apt-get Part

Alias install= ' sudo apt-get install '

Alias remove= ' sudo apt-get remove '

Alias update= ' sudo apt-get update '

Alias upgrade= ' sudo apt-get upgrade | Tee ~/documents/' Date +%f_%h:%m:%s-upgrade.log '

Alias dist-upgrade= ' sudo apt-get dist-upgrade | Tee ~/documents/' Date +%f_%h:%m:%s-dist-upgrade.log '

Alias autoclean= ' sudo apt-get autoclean '

Alias autoremove= ' sudo apt-get autoremove '

Alias purge= ' sudo apt-get purge '

Alias build-dep= ' sudo apt-get build-dep '

Alias check= ' sudo apt-get check '

Alias download= ' sudo apt-get download '

Alias dselect-upgrade= ' sudo apt-get dselect-upgrade '

Alias clean= ' sudo apt-get clean '

# Home Part

Alias dl= ' CD ~/downloads '

Alias dc= ' CD ~/documents '

Alias bi= ' CD ~/bin '

Alias conf= ' CD ~/.config '

Alias cache= ' CD ~/.cache '

Alias pic= ' CD ~/pictures '

# ls Part

Alias ls= ' Ls-g '

Alias Ll= ' Ls-alf '

Alias La= ' Ls-a '

Alias l= ' ls '

Alias Vi= ' Vim '

Alias hist= ' History | grep

Alias cls= ' Clear '

Alias cpan= ' sudo perl-mcpan-e shell '

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 goagent= ' sudo python/media/ray/software/program\ files/goagent-3.0/local/proxy.py '

Alias srcprofile= ' Source ~/.BASHRC '

Alias viprofile= ' Vim ~/.BASHRC '

Alias kernels= ' sudo dpkg--get-selections | grep "^linux" '

Variable words (. bash_variables)

# for setting history length see Histsize and Histfilesize in Bash (1)

histsize=1000000

histfilesize=2000000

histtimeformat= "%f/%h:%m:%s"

Lscolors= "Gxfxaxdxcxegedabagacad"

# path= "$PATH"

sys= '/media/ray/system '

sft= '/media/ray/software '

dat= '/media/ray/data '

Dest= '/media/ray/system/users/ray/desktop '

function words (. bash_functions)

The above is based on LINUX/GNU, because can include, but Mac is not so good to write in the. bash_profile

In your Mac

Alias function varibales in Linux/gnu and MAC alias command detail

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.