linux 命令shuf

 1 shuf --help
 2 用法: shuf [选项]... [文件]
 3  或者:  shuf -e [选项]... [参数]...
 4  或者:  shuf -i LO-HI [选项]...
 5 Write a random permutation of the input lines to standard output.
 6 
 7 如果没有指定文件,或者文件为"-",则从标准输入读取。
 8 
 9 必选参数对长短选项同时适用。
10   -e, --echo                treat each ARG as an input line
11   -i, --input-range=LO-HI   treat each number LO through HI as an input line
12   -n, --head-count=COUNT    output at most COUNT lines
13   -o, --output=FILE         write result to FILE instead of standard output
14       --random-source=FILE  get random bytes from FILE
15   -r, --repeat              output lines can be repeated
16   -z, --zero-terminated     line delimiter is NUL, not newline
17       --help        显示此帮助信息并退出
18       --version        显示版本信息并退出
19 
20 GNU coreutils online help: <http://www.gnu.org/software/coreutils/>
21 请向<http://translationproject.org/team/zh_CN.html> 报告shuf 的翻译错误
22 Full documentation at: <http://www.gnu.org/software/coreutils/shuf>
23 or available locally via: info '(coreutils) shuf invocation'

ps:

shuf train.txt -o test.txt -n 30

从train.txt文件中随机读取30行文本输出到test.txt

 

转载于:https://www.cnblogs.com/yangwithtao/p/7047988.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值