yes command in linux is used to print a continuous output stream of given STRING. If STRING is not mentioned then it prints ‘y’;
Note: To stop printing please press Ctrl + C.
Question: Where it is used ?
Ans: Lets say that we want to delete all the
.txt file present in the current directory. Instead of writing
rm -i *.txt and then typing y at the end for every file, what we can do is we can use
yes | rm -i *.txt.
- yes –help : It displays help information.
- yes –version : It displays version information.