In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article focuses on "how to use regular expression commands in the Linux system". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to use regular expression commands in Linux system.
Text file operation command: text file operation command
Cat
Cat is an acronym for concatenate, so its purpose is actually to connect files. By default, however, it sends the results of the connection file to standard output. So we often use it to display the contents of the file. Similar to type in dos.
Parameters:
-n or-- number numbers all output lines starting with 1
-b or-- number-nonblank is similar to-n, except that blank lines are not numbered
When-s or-- squeeze-blank encounters blank lines with more than two consecutive lines, replace them with blank lines of one line
-v or-- show-nonprinting
# cat / etc/passwd View user account files
More
When the content of a file exceeds one screen, we can use the more command to view the contents of the file screen by screen.
# more install.log View install.log File
Less
On the basis of more, less can look at it line by line and turn the page back and forth.
# less / etc/shadow View user password File
Head
Head displays the first part of the file. By default, the first ten lines of parameters-lines or-n indicate the basic format of the number of lines displayed:
Head [parameters] file
-the first N bytes of the cN output file.
-the first N lines of the nN output file.
-Q does not output information about the file name.
-v outputs information about the file name.
-- help outputs help on standard output and exits.
-- version outputs version information on standard output and exits
# head / etc/mail/sendmail.mc view the first 10 lines of the file by default
# head-n 20 / etc/passwd View the first 20 lines of the file
Tail
Tail displays the end of the file, the command usage is the same as head, and the parameter-f shows the documentary update of the file, which is used to monitor the log file.
Tail displays the last 10 lines of each file in the file list by default. If there is no file name or the file name is "-", it reads the file from standard input, and if there are multiple files, it will precede the file with "= > file name."
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.