Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tools shuf #28

Open
junxnone opened this issue Sep 18, 2019 · 0 comments
Open

Tools shuf #28

junxnone opened this issue Sep 18, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@junxnone
Copy link
Owner

junxnone commented Sep 18, 2019

shuf 随机选取工具

  • 随机排列输入行
  • 可以用来随机排列文件/数据
  • 可以用 -n 随机选取文件
-e, --echo                  将每个ARG视为输入行。
-i, --input-range=LO-HI     将数字范围LO(最低)到HI(最高)之间的作为输入行。
-n, --head-count=COUNT      只输出前COUNT行。
-o, --output=FILE           将结果写入到文件而不是标准输出。
    --random-source=FILE    将FILE中内容作为随机数据源。
-r, --repeat                输出行可以重复。
-z, --zero-terminated       行终止符为NUL(空字符)而不是默认的换行符。
--help                      显示帮助信息并退出。
--version                   显示版本信息并退出。

UseCase

随机选取三张图片

ls images/* |shuf -n 3

生成随机数

shuf -i 1-100 -n 1
@junxnone junxnone changed the title Linux - tools shuf Linux - tools - shuf Sep 18, 2019
@junxnone junxnone changed the title Linux - tools - shuf Linux shuf Sep 20, 2021
@junxnone junxnone transferred this issue from junxnone/Linux_archive Sep 20, 2021
@junxnone junxnone changed the title Linux shuf Linux Tools shuf Dec 18, 2022
@junxnone junxnone transferred this issue from junxnone/techwiki Dec 20, 2022
@junxnone junxnone changed the title Linux Tools shuf Tools shuf Dec 21, 2022
@junxnone junxnone added the enhancement New feature or request label Dec 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant