In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you what is the use of regular expressions in linux, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's learn about it!
1. Auxiliary information
1.1. File format
Working on Linux, the binary format is very, very exclusive, and almost everything is text content that can be read and written. The results generated by most commands are also text files. These files have some features, usually columns and columns are separated by spaces or keys. For example, the following lsmem results, such a regular, rule-based document, is very easy to deal with.
[root@localhost] # lsmem RANGE SIZE STATE REMOVABLE BLOCK 0x0000000000000000-0x0000000007ffffff 128m online no 0 0x0000000008000000-0x000000000fffffff 128m online yes 1 0x0000000010000000-0x0000000017ffffff 128m online no 2 0x0000000018000000-0x0000000027ffffff 256m online yes 3-4 0x0000000028000000-0x000000004fffffff 640M online no 5-9 0x0000000050000000-0x000000005fffffff 256m online yes 10-11 0x0000000060000000-0x000000007fffffff 512M online no 12-15 Memory block size: 128M Total online memory: 2G Total offline memory: 0B
There are a large number of commands for row operations as well as a number of commands for column operations. Then, there are two aggregators called sed and awk. Because of the large number of contents of these two commands, we will classify them as separate chapters.
1.2. Help information
Linux commands are usually very simple, but some are somewhat complex. Commands such as find,ps may require a lot of space if you want to take care of all the situations. But what if such a side-door situation is used?
It is necessary to have a comprehensive understanding in order to evoke the shallowest impression in memory when using it. Then the rest can be given to commands like man. Every command on Linux will have a matching help file, which is much more correct than the information transferred back and forth on the network.
Formally introduce the following two commands:
Man is used to display document information for a command. For example: man ls
Info you can think of as the same as man, although there is some complementary content. They will be prompted in the content.
-- help many commands provide very short help information through the argument-- help. This is usually the most useful and quickest use case presentation. If you can't remember a very mouthful word at all, look for these places.
Note: these help messages focus only on the scope of the command itself. There is not much information about its combined usage scenarios. In other words, it teaches you how to use it, but it doesn't tell you what you can do with it.
These help commands generally increase the reading experience by highlighting keywords. But we can go one step further and turn the help files into color. Under root, execute the following command. Then log in to the virtual machine again.
Cat > > ~ / .bashrc
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.