linux中的yes命令,Linux中yes命令起什么作用呢?

本文详细介绍了Linux中的yes命令,该命令用于在终端上无限次重复输出指定的字符串,直到用户通过按下Ctrl+C中断。示例中展示了yes命令的基本用法,包括输出版本信息和帮助信息,以及如何输出特定字符串如'maomao365.com'。yes命令是Linux系统中的一个实用工具,常用于自动化脚本中。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

摘要:

下文讲述Linux中yes的功能说明,如下所示;

yes命令功能:

用于在终端上重复输出字符串,

直到在终端上使用“ctrl + c ”命令终止yes命令时,

才会停止运行输出字符串信息

yes命令的语法格式:

yes [字符串]

-----常用参数说明------

-- -help:输出帮助信息

-- -version:输出命令版本信息

例:

yes命令的示例分享

[root@maomao365.com ~]# yes --version

yes (GNU coreutils) 8.4

Copyright (C) 2010 Free Software Foundation, Inc.

License GPLv3+: GNU GPL version 3 or later .

This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law.

Written by David MacKenzie.

[root@maomao365.com ~]# yes --help

Usage: yes [STRING]...

or: yes OPTION

Repeatedly output a line with all specified STRING(s), or `y'.

--help display this help and exit

--version output version information and exit

Report yes bugs to bug-coreutils@gnu.org

GNU coreutils home page:

General help using GNU software:

For complete documentation, run: info coreutils 'yes invocation'

[root@maomao365 ~]# yes maomao365.com

maomao365.com

maomao365.com

maomao365.com

maomao365.com

maomao365.com

...

//当按键盘ctrl+c 才会终止输出

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值