In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you "Linux common command seq how to use", the content is easy to understand, clear, hope to help you solve doubts, the following let the editor lead you to study and learn "Linux common command seq how to use" this article.
The common Linux command seq is an abbreviation for a sequence, which is mainly used to output serialized things.
# I. basic usage of commands
1. Specify only the end value
Seq [options]... If the end value is less than 1, the end value is negative, zero, and positive decimal, no error will be reported, but the output is empty; if the end value is equal to 1, the output is 1.
[test@Test ~] $seq 10 1 2 3 4 5 6 7 8 9 10 [test@Test ~] $seq-5 [test@Test ~] $seq 1 1 [test@Test ~] $seq 0.2 [test@Test ~] $2, specify the start and end values, and the default increment is 1.
Seq [options]... The start value the end value is larger than the end value and will not report an error, but the output is empty.
[test@Test ~] $seq-1 1-1 01 [test@Test ~] $seq-1-5 [test@Test ~] $3, specify start, increment and end values
Seq [options]... Start value increment end value Note: when the increment is 00:00, the seq command executes indefinitely and outputs the starting value indefinitely. You should avoid specifying an increment of zero. If the increment is zero, you can end the command with "ctrl" + "c" after executing the command.
[test@Test] $seq-0.1 0.05 0.1-0.10-0.05 0.00 0.05 0.10 [test@Test] $seq 0.1-0.05-0.1 0.10 0.05 0.00-0.05-0.10 [test@Test] $seq 0.1 0.05 0.1 0.10 [test@Test] $seq 0.1 100 0.1 [test@Test] $II, options and parameters-f -- format= format uses printf-style floating-point format-s,-- separator= string uses the specified string to separate numbers (default:\ n)-w,-- equal-width adds 0 before the column to make the width the same note: "- f" and "- w" cannot use the use of "- f" at the same time.
-f'% [plus or minus sign] [fill symbol] [display number of digits] g'[plus or minus sign]: "+" or omitted. "+" will be preceded by "+" before all zero and positive numbers of the output, but will not be displayed. "+" will occupy a display bit.
[test@Test] $seq-f'% + 06g'-0.3 0.1 0.3-000.3-000.2-000.1 + 00000 + 000.1 + 000.2 + 000.3 [test@Test ~] $seq-f 'g'-0.3 0.1 0.3-000.3-000.2-000.1 000000 0000.1 0000.2 0000.3 [test@Test] $[padding symbol]: "0" or space. " 0 ", plus or minus sign on the far left; space, plus or minus sign next to the number
[test@Test] $seq-f'% 6g'-0.3 0.1 0.3-0.3-0.2-0.100 0.1 0.2 0.3 [test@Test] $seq-f'% + 6g'- 0.3 0.1 0.3-0.3-0.2-0.1 + 0 + 0.1 + 0.2 + 0.3 [display bits]: the number of bits per output. If you set a negative number of bits here or occupy less than the actual space, then the setting is invalid. Note: when using "- f", when the increment is close to zero, the scientific counting method may appear.
[test@Test] $seq-f'% + 010g'- 0.10.010.1-0.090.080.070.060.050.040.030.020.01-6.77626e-21 + 0.020.030.040.04 + 0.050. 06 + 0.07 + 0.08 + 0.09 + 0.1 [test@Test] $seq-0.01 0.1-0.10-0.09-0.08-0.07-0.06-0.04-0.02-0.02-0.000 0.01 0.02 0.03 0.04 0.06 0.07 0.08 0.09 0.102, The usage of "- s"
[test@Test ~] $seq-s'|'- 11-1 | 0 | 13, "- w" usage
[test@Test] $seq-w-111-100 is all the contents of this article entitled "how to use seq with Linux commands". 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: 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.