Files
tldr/pages.zh/osx/shuf.md

20 lines
324 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# shuf
> 生成随机排列。
- 随机化文件中的行顺序并输出结果:
`shuf {{文件名}}`
- 只输出结果的前 5 条:
`shuf -n {{5}} {{文件名}}`
- 将结果输出写入另一个文件:
`shuf {{文件名}} -o {{输出_文件名}}`
- 生成范围1-10内的随机数
`shuf -i {{1-10}}`