In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you to use the logsave command in linux to save the output information to the specified log file, I believe that most people do not know much about it, so share this article for you to learn. I hope you will learn a lot after reading this article. Let's learn the method together.
The logsave program executes cmd_prog with the specified parameters and saves a copy of its output to logfile. If the include directory of the log file does not exist, logsave accumulates output in memory until it can be written out. A copy of the output is also written to standard output.
If the command prog is a single hyphen ("-"), then logsave will take its input from standard input and save it in a log file instead of executing the program, and logsave is useful for saving the output of the initial startup script until the / var partition is loaded, so the output can be written to / var/log.
Syntax format: logsave [parameters]
Common parameters:
-an append information to the specified log file-s displays log information and does not write to the file
Reference example
Save the output log information to the specified file:
[root@linuxcool] # logsave / tmp/logdir/logfile bash-c "sleep 2 position date"
Use the-a parameter to append information to the log file:
[root@linuxcool ~] # logsave-a / tmp/logdir/logfile bash-c "sleep 2 date" above are all the contents that use the logsave command in linux to save the output information to the specified log file, thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow 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: 205
*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.