Alias commands in Linux

Source: Internet
Author: User
Tags egrep

In Linux, you often need to switch directories, Which is troublesome. Then you think of the alias command, which can be used to convert a long command into a short command that we like. sort out the usage of this command for future convenience.

Function Description: sets the alias of an instruction.

Syntax: alias [alias] = [command name]

Parameter: If no parameter is added, all alias settings are listed.

For example:

Root @ czu :~ /Projects/myshell/srce # alias

Alias begin = 'mount-t vmhgfs. host: // mnt/hgfs /'

Alias egrep = 'egrep -- color = auto'

Alias fgrep = 'fgrep -- color = auto'

Alias gopj = 'CD/root/Project'

Alias grep = 'grep -- color = auto'

Alias l = 'LS-CF'

Alias la = 'LS-'

Alias ll = 'LS-alf'

Alias ls = 'ls -- color = auto'

Alias work = 'CD/mnt/hgfs/vmwarefolder'

Note: You can use alias to customize the alias of a command. if you only enter alias, all current alias settings can be listed. the role of alias is limited to the login operation. if you want to automatically set an alias for each login, you can go to/etc/profile or your own ~ /. Set the alias of the command in bashrc.

Also, if you want to apply an alias to each user, add the alias to the end of/etc/bashrc. bashrc is the configuration file of environment variables./etc/bashrc and ~ /. The difference between bashrc and bashrc is that it is set for all systems to be set for individual users.

To take effect permanently, write this entry to/etc/bashrc.

Detailed description of alias commands in Linux

Linux Command alias/unalias

Usage of alias in Ubuntu

Practical application of Linux/shell commands -- added custom commands in alias

Linux alias command parameters and usage-Linux definition command alias

General problems of alias in Ubuntu

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.