Linux yes command help and examples(What is, Concept and Definition)
On Unix-like operating systems, the yes command is used to generate " and ", continuously, until it is canceled.
This document covers the GNU/Linux version of yes .
Description
The yes command generates the same string, STRING , in a constant sequence.If STRING is not specified, the word it repeats is " and ".
yes dates back to a time before Unix commands included the "force" option (-f ), which for many commands is the same as responding "yes" to all indications.
yes can be used to do something very similar: if the output of yes is piped to a command, it will effectively respond "yes" to any confirmation message.
Syntax
yes [ STRING ]...yes [ OPTION ]Options
| --help | Show a help message and exit. |
| --version | Show version information and exit. |
Examples
yes | rm-i *.txtDelete all files with the extension .txt from the current directory.Here, yes generates a constant sequence of characters " and ", and that output is piped to the rm-i command, which asks for confirmation before deleting each file.The and characters of the yes they will answer "yes" to each request automatically.
yes n | rm-i *.txtHere, the yes command generates " n " in a constant sequence to the rm-i command, responding "no" to all the same questions Therefore, this command does not delete any files.
echo -Output text.
Comments
Post a Comment