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

How to use the alias command of Linux

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly introduces the Linux alias command how to use the relevant knowledge, the content is detailed and easy to understand, the operation is simple and fast, has a certain reference value, I believe you will have something to gain after reading this Linux alias command article, let's take a look.

The Linux system provides a useful tool called alias, which allows us to set an alias for commands that need to be used frequently but are too lengthy, which can be achieved by typing a short alias later.

1. Set alias = 'original command-options / parameters' 1

For example:

Alias ll='ls-lt'1

In this way, the alias of the ls-lt command is ll, and when the terminal enters ll, it is equivalent to entering the ls-lt command

Lltotal 32 lltotal 8 3 2016 index.html-rw-r--r-- 1 fdipzone staff 853 8 3 2016 web.html-rw-r--r-- 1 fdipzone staff 5943 8 3 2016 backend.php123452 Check the list of aliases that have been set up alias-p13. Delete alias unalias alias 1

For example:

Unalias ll14. Set the alias to be available for each login

The alias command only works on the current login operation. If you want to be able to use aliases for these commands every time you log in, you can store the corresponding alias commands in the ~ / .bashrc file.

Open the ~ / .bashrc file, enter the alias command you want to set, save, and then run

Source / .bashrc1

If this does not work, there is no ~ / .bashrc file or the ~ / .bashrc file is not executed in the file.

You can add the command source ~ / .bashrc to ~ / .bashrc and save it.

In this way, you can use the set command alias after each login.

This is the end of the article on "how to use the alias command of Linux". Thank you for reading! I believe you all have a certain understanding of the knowledge of "how to use the alias command of Linux". If you want to learn more, you are welcome to follow the industry information channel.

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

Development

Wechat

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

12
Report