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

Example Analysis of Command Line aliases in Linux

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

Share

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

This article mainly shows you the "sample analysis of command line aliases in Linux", which is easy to understand and well-organized. I hope it can help you solve your doubts. Let the editor lead you to study and study the "sample analysis of command line aliases in Linux".

Preface

In the process of managing and maintaining the Linux system, a large number of commands will be used, and some very long commands or usage are often used, and it is not advisable to enter a long command or usage repeatedly and frequently. At this point, you can use the command alias feature to simplify the process.

Some aliases are included by default in the Linux distribution you install.

The Linux command line alias is perfect for helping you improve your productivity. Even better, some aliases are included by default in the Linux distribution you install.

This is an example of a command alias in Fedora 27:

This alias command lists existing aliases. Setting aliases is also very simple:

Alias new_name= "command"

Here are 15 command line aliases to save you time:

1. Install any application utilities / applications:

Alias install= "sudo yum install-y"

Here, depending on each user's preference, sudo and-y are optional:

2. Update the system:

Alias update= "sudo yum update-y"

3. Upgrade the system:

Alias upgrade= "sudo yum upgrade-y"

4. Switch root users:

Alias root= "sudo su -"

5. Switch to the "user" user, where user is set to your user name:

Alias user= "su user"

6. Display and list all available ports, status and IP:

Alias myip= "ip-br-c a"

7. Ssh to your server myserver:

Alias myserver= "ssh user@my_server_ip"

8. List all processes in the system:

Alias process= "ps-aux"

9. Check the service status of the system:

Alias sstatus= "sudo systemctl status"

10. Restart system services:

Alias srestart= "sudo systemctl restart"

11. Kill the process by name:

Alias kill= "sudo pkill"

12. Show that the system always uses memory and free memory:

Alias mem= "free-h"

13. Display the system CPU framework structure, number of CPU, number of threads, etc.

Alias cpu= "lscpu"

14. Display the total disk size of the system:

Alias disk= "df-h"

15. Display the current system Linux release version (for CentOS, Fedora and Red Hat):

Alias os= "cat / etc/redhat-release"

The above is all the content of the article "sample Analysis of Command Line aliases in Linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, 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

Servers

Wechat

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

12
Report