Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the function of the alias command in CentOS

2025-01-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

What is the function of alias command in CentOS? I believe many inexperienced people don't know what to do about it. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

Alias command

Function description: when we are working on the management of the system, there must be some long commands that we often use regularly. Then we can give these long lists of orders an alias. After that, when you need this long list of commands, you can directly replace it with an alias. There are already some default command aliases in the system. You can check it out by alias. You can also check ~ /. Bash_profile under the home directory, which is an alias that belongs to the user. If you want to define a global alias, you can write the definition to the / etc/bashrc archive. Aliases via alias are automatically cleared after the system is rebooted. After the modification, it will not take effect until it is source.

Syntax: alias [alias] = [instruction name]

Cancel alias: unalias [alias]

Examples of use:

(1) aliases that exist by default

[root@LiWenTong test4] # alias

Alias cp='cp-i'

Alias l.='ls-d. *-color=tty'

Alias ll='ls-l-color=tty'

Alias ls='ls-color=tty'

Alias mv='mv-i'

Alias rm='rm-i'

Alias which='alias | / usr/bin/which-- tty-only--read-alias-- show-dot-- show-til

Note: when defining aliases, there can be no spaces on both sides of the equal sign.

After reading the above, have you mastered the function of the alias command in CentOS? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report