In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how to mark Linux commands. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
Mark the Linux command
We can tag some complex commands that remind you of the purpose of the Linux command. After applying tags to Linux commands, we don't have to enter long and complex commands, we just need to enter the tag characters we set up to OK!
Let's demonstrate a command, such as finding and listing files greater than 10MB in the current directory, and sorting them by size:
$find. -size + 10m-type f-print0 | xargs-0 ls-Ssh | sort-z
I wonder if you remember what this order is for? If you don't remember, part of it will be taken apart and analyzed by yourself.
Because it is too long to see the effect at a glance, we can add a memorable mark at the end of it, preferably reflecting the function of the command, such as setting ListFilesBiggerThanXSize here:
$find. -size + 10m-type f-print0 | xargs-0 ls-Ssh | sort-z # ListFilesBiggerThanXSize
Note: start with # and there is a space between the command and the label name.
Try the effect quickly and enter the tag you just saw:
$! # ListFilesBiggerThanXSize
Over here, Jack! And? Operator is used to get and run the commands we previously marked from the BASH history.
[alvin@VM_0_16_centos] $find. -size + 10m-type f-print0 | xargs-0 ls-Ssh | sort-z # ListFilesBiggerThanXSize total 104K 16K httpd.c 16K shakespeare 12K hello 4.0K dir2 [alvin@VM_0_16_centos ~] $!? # ListFilesBiggerThanXSize find. -size + 10m-type f-print0 | xargs-0 ls-Ssh | sort-z # ListFilesBiggerThanXSize total 104K 16K httpd.c 16K shakespeare 12K hello 4.0K dir2
Another way
Another method of memory is "nickname", that is, the use of alias command, we should be familiar with, the principle is similar to marking.
For example, give us a nickname for the above command:
$alias ListFilesBiggerThanXSize='find.-size + 10m-type f-print0 | xargs-0 ls-Ssh | sort-z'
Enter directly when using:
This is the end of the ListFilesBiggerThanXSize article on "how to mark Linux commands". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.