In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly describes how linux to replace strings, the text is very detailed, has a certain reference value, interested friends must read!
In linux, you can replace strings with the sed command, which is mainly used to automatically edit one or more files. When the parameter is set to "s", you can replace the contents with the syntax "sed 's/original string/new string/' file".
Operating environment: Linux 7.3 system, Dell G3 computer.
In linux you can replace strings with sed.
The syntax is as follows:
sed 's/original string/new string/' file sed 's/original string/new string/g' file
The difference between the two command formats is whether there is a "g." There is no "g" to replace only the first matching string, there is "g" to replace all matching strings,"g" can be regarded as the abbreviation of "global"(global), do not replace all without "global" ending, so it is easy to remember.
Command can be processed using regular expressions. As shown below, the first command only replaces the first "b" with "B", and the other commands are not replaced; while the second command replaces all the numbers in the text with "good".
Examples are as follows:
That's all for "how linux replaces strings." Thanks for reading! Hope to share the content to help everyone, more relevant knowledge, welcome to pay attention to 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.
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.