Simplifying command input with alias

Source: Internet
Author: User
Tags bz2 command line ssh

For those of you who like the command line, you will certainly like the simple command of ' ls '. If you want to get more of these commands, you can use the alias to implement it.

The alias is an internal command of the shell used to provide aliases for longer commands. Format is as follows

Alias name = "Long Command"

It is convenient to write such an alias statement into ~/.BASHRC.

The alias in My. BASHRC. Related content

export LS_OPTIONS='--color=auto'
 eval `dircolors`
 alias ls='ls $LS_OPTIONS'
 alias ll='ls $LS_OPTIONS -l'
 alias l='ls $LS_OPTIONS -lA'
 alias tz="tar zxfv"
 alias tj="tar jxfv"
 alias psl="ps aux | grep "
 alias ai="apt-get install"
 alias ais="apt-get source"
 alias ac="apt-get clean"
 alias au="apt-get update"
 alias adu="apt-get dist-upgrade -u"
 alias ar="apt-get remove"
 alias as="apt-cache search"
 alias ash="apt-cache show"

Briefly explain a few

When input l carriage is executed LS $LS _options-la

TJ is used to extract tar.bz2 files. Using TJ file.tar.bz2 is to use TAR-JXF ile.tar.bz2,

TZ Similar

PSL is used to view processes, such as if you want to see if Apache is running, directly PSL APA. You can also add-C to count the numbers.

A few of the beginning of a is used to simplify the use of APT-GET commands, a look at the understanding.

If you need to frequently use SSH to log on to a remote host, you can add a

Alias ssh10= "Ssh-l root 192.168.1.10"

The direct input ssh10 is OK. Is it a lot easier?

What other good things do you have?

Note: When you edit the ~/.BASHRC, you want it to take effect immediately without having to log on/Open the terminal, you can reload it using the source ~/.BASHRC. BASHRC.

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.