yes command in Linux with Examples
yes command in linux is used to print a continuous output stream of given STRING. If STRING is not mentioned then it prints ‘y’;
Syntax:
yes [STRING]
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
.
Options:
- yes –help : It displays help information.
- yes –version : It displays version information.
Please Login to comment...