Linux under the alias command detailed

Source: Internet
Author: User
Tags egrep

Linux under the alias command detailed
Description of Use

Sets the alias of the command. In a Linux system, if the command is too long and does not conform to the user's habits, then we can specify an alias for it. Although you can create a "link" for a command

Resolves a long file name problem, but for commands with command-line arguments, the link is powerless. The specified alias can resolve all of these problems, "1". Common aliases to simplify

SSH Login "See example three", make the long command shorter, so that the usual long command line shorter, forced to execute the command when asked.

Feature Description: sets the alias of the directive.

syntax:alias[alias]=[directive name]

If no parameters are added, all current alias settings are listed.

[Email protected]:~$ alias

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 '

Description: user can use alias, custom instruction aliases.

If you enter alias only, you can list all of the current alias settings.

Attention:

Alias can be used to turn a long command into any of our favorite short

Alias is only valid for the login operation. To automatically set an alias every time you log in, you can set an alias for the directive in/etc/profile or your own ~/.BASHRC.

File:

/etc/profile or he refers to other files (such as/ETC/BASH.BASHRC in Ubuntu 12.0.4). This is a global one. It is not recommended to modify this file, the error will cause startup problems.

If you want to give each user an alias, add alias la= ' Ls-al ' line to the last side of the/ETC/BASHRC, BASHRC is the configuration file for the environment variable

~/.BASHRC is the current user, but it must be done before bash is started.

The difference between/ETC/BASHRC and ~/.BASHRC is that one is set to a system-wide one that is set up for single-user use.

Of course: For how to cancel an alias for a command in Linux

1, if added in the configuration file, you need to modify, delete the corresponding statement

2, if only temporary effect, you can enter the unalias corresponding command (such as: Unalias clear) can

[Email protected]:~$ alias c=clear[email protected]:~$ Unalias Clear


Linux under the alias command detailed

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.