In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you how to use the cut command 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 go to know it!
The Linux cut command is used to extract the contents of the file based on the field. Text files do not have rows / columns like a database, and sometimes we only need single-column data. Cut the identified columns according to the delimiter (for example, colon':', semicolon';', comma',', etc.).
For the following example, we use the / etc/passwd file. All lines are stored in the following format, with colons (:) separated as follows. We use-f to specify the field number and-d as the delimiter.
According to the picture above, this file has seven fields. Cut also supports getting values on the character-based suing-c command line switch. Let's take a look at the following example, using the / etc / passwd file.
1. Select a single field from the file:
For example, we need a list of user names in the / etc/passwd file. We know that the first column stores the user name, and the entire file is separated by a colon (:).
# cut-d ":"-F1
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.