Linux Next alias command specific explanation

Source: Internet
Author: User
Tags egrep

Linux Next alias command specific explanation
Description of Use

Sets the alias of the command. Assuming that the command is too long and not consistent with the user's habits in a Linux system, we can assign an alias to it.

Although it is possible to establish a "link" to the command

Resolves a problem with long file names, but for commands with command-line parameters, the link is powerless. Specifying an alias can solve all of these problems.

Often use aliases to simplify

SSH login. Shorten the long command. Makes frequently used long command lines shorter, forcing commands to be queried when running, and so on.

Feature Description: sets the alias of the directive.

syntax:alias[alias]=[directive name]

If you do not add any number of parameters. Lists all of the alias settings at the moment.

[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 take advantage of alias. The alias of the custom directive.

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

Attention:

Using alias can turn a very long command into a casual, short, we like.

Alias is only valid for the login operation. Each time you log in, you are actively setting up an alias. You can set an alias for an instruction 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 change this file, the error will cause startup problems.

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

~/.BASHRC is the current user. Just have to start bash before it is implemented.

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 the alias of a command in Linux

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

2, assuming only temporary effect, can input unalias corresponding commands (such as: Unalias clear) can

[Email protected]:~$ alias C=clear

[Email protected]:~$ Unalias Clear


Linux Next alias command specific explanation

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.