In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the use of the shuf command in Linux, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
The common Linux command shuf is used to output input lines to standard output in random order.
Shuf produces random permutations.
Summary shuf [OPTION]... [FILE] shuf-e [OPTION]. [ARG]... Shuf-I LO-HI [OPTION]... The main purpose is to randomly arrange and output the input.
Read standard input when there is no file or when the file is -.
The option-e,-- echo treats each ARG as an input line. -I,-- input-range=LO-HI takes the numeric range from LO (lowest) to HI (highest) as the input line. -n,-- head-count=COUNT outputs only the previous COUNT lines. -o,-- output=FILE writes the results to a file instead of standard output. -- random-source=FILE uses the content in FILE as a random data source. -r,-- repeat output lines can be repeated. -z,-- zero-terminated line Terminator is NUL (null character) instead of the default newline character. -- help displays help information and exits. -- version displays version information and exits. Parameter FILE (optional): any number of files to be processed.
ARG (optional): a string as an input line, which can be any number.
A return value of 0 indicates success, while a non-zero value indicates failure.
Example # simulated coin toss Get the first 10 results: [user2@pc ~] $head-r-n 10-e "heads"-e "tails" heads # Sports Lottery Super Lotto: [user2@pc ~] $shuf-I 1-35-n 5 | sort-n & & shuf-I 1-12-n 2 | sort-n 4 17 20 29 31 6 11 Note this command is a command in the GNU coreutils package For more detailed help, please see man-s 1 shuf,info coreutils' shuf invocation'.
Thank you for reading this article carefully. I hope the article "what is the use of shuf commands in Linux" shared by the editor will be helpful to you. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
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.