yes

打印命令行参数,用空格分隔,后跟换行符,直到被杀死。当管道输入命令时,它将继续直到管道中断(即程序完成其执行)

语法

  yes text
  yes --help
  yes --version

选项

text       要重复的文本
--help     显示帮助
--version  显示版本号。

如果没有给出参数,则打印“y”,然后永久打印换行符直到被杀死

与head一起使用yes 可用于生成大型测试文件。例如,执行

yes 123456789 | head -1000 > file.txt

得到一个1000行的文件,每行包含10个字符(1,2,3,4,5,6,7,8,9和换行符).

使用yes会导致100%的处理器使用率,因此除了用于测试例如最大化计算机的CPU之外,很少使用它。

yes 命令实例:

linux命令:yes "\\__/ " | tr "\n" " " | fold -$((($COLUMNS-3)/6*6+3)) | head -$LINES -$LINES head | -$((($COLUMNS-3)/6*6+3)) fold | " " "\n" tr | " "\\__/ yes yes "\\__/ " | tr "\n" " " | fold -$((($COLUMNS-3)/6*6+3)) | head -$LINESrootopen.com
linux命令:yes "\\__/ " | tr "\n" " " | fold -$((($COLUMNS-3)/6*6+3)) | head -$LINES -$LINES head | -$((($COLUMNS-3)/6*6+3)) fold | " " "\n" tr | " "\\__/ yes yes "\\__/ " | tr "\n" " " | fold -$((($COLUMNS-3)/6*6+3)) | head -$LINESrootopen.com
2018-12-02 21:26:03

linux命令:yes 我很棒 我很棒 yes yes 我很棒rootopen.com
linux命令:yes 我很棒 我很棒 yes yes 我很棒rootopen.com
2018-11-17 12:11:20

linux命令:yes "$(seq 232 255;seq 254 -1 233)" | while read i; do printf "\x1b[48;5;${i}m\n"; sleep .01; done done .01; sleep "\x1b[48;5;${i}m\n"; printf do i; read while | 233)" -1 254 255;seq 232 "$(seq yes yes "$(seq 232 255;seq 254 -1 233)" | while read i; do printf "\x1b[48;5;${i}m\n"; sleep .01; donerootopen.com
linux命令:yes "$(seq 232 255;seq 254 -1 233)" | while read i; do printf "\x1b[48;5;${i}m\n"; sleep .01; done done .01; sleep "\x1b[48;5;${i}m\n"; printf do i; read while | 233)" -1 254 255;seq 232 "$(seq yes yes "$(seq 232 255;seq 254 -1 233)" | while read i; do printf "\x1b[48;5;${i}m\n"; sleep .01; donerootopen.com
2018-04-06 19:42:48

linux命令:yes 'Y'|gdb -ex 'p close(1)' -ex 'p creat("/tmp/output.txt",0600)' -ex 'q' -p pid pid -p 'q' -ex creat("/tmp/output.txt",0600)' 'p -ex close(1)' 'p -ex 'Y'|gdb yes yes 'Y'|gdb -ex 'p close(1)' -ex 'p creat("/tmp/output.txt",0600)' -ex 'q' -p pidrootopen.com
linux命令:yes 'Y'|gdb -ex 'p close(1)' -ex 'p creat("/tmp/output.txt",0600)' -ex 'q' -p pid pid -p 'q' -ex creat("/tmp/output.txt",0600)' 'p -ex close(1)' 'p -ex 'Y'|gdb yes yes 'Y'|gdb -ex 'p close(1)' -ex 'p creat("/tmp/output.txt",0600)' -ex 'q' -p pidrootopen.com
2018-02-25 01:00:48

linux命令:yes "text" | annoying_installer_program # "text" defaults to the letter y y letter the to defaults "text" # annoying_installer_program | "text" yes yes "text" | annoying_installer_program # "text" defaults to the letter yrootopen.com
linux命令:yes "text" | annoying_installer_program # "text" defaults to the letter y y letter the to defaults "text" # annoying_installer_program | "text" yes yes "text" | annoying_installer_program # "text" defaults to the letter yrootopen.com
2018-03-28 21:59:48

linux命令:yes '' | cat -n -n cat | '' yes yes '' | cat -nrootopen.com
linux命令:yes '' | cat -n -n cat | '' yes yes '' | cat -nrootopen.com
2018-02-15 19:12:48

linux命令:yes "$(seq 232 255;seq 254 -1 233)" | while read i; do printf "\x1b[48;5;${i}m\n"; sleep .01; done done .01; sleep "\x1b[48;5;${i}m\n"; printf do i; read while | 233)" -1 254 255;seq 232 "$(seq yes yes "$(seq 232 255;seq 254 -1 233)" | while read i; do printf "\x1b[48;5;${i}m\n"; sleep .01; donerootopen.com
linux命令:yes "$(seq 232 255;seq 254 -1 233)" | while read i; do printf "\x1b[48;5;${i}m\n"; sleep .01; done done .01; sleep "\x1b[48;5;${i}m\n"; printf do i; read while | 233)" -1 254 255;seq 232 "$(seq yes yes "$(seq 232 255;seq 254 -1 233)" | while read i; do printf "\x1b[48;5;${i}m\n"; sleep .01; donerootopen.com
2018-03-15 22:54:48

linux命令:yes | tr 'y' 'n' 'n' 'y' tr | yes yes | tr 'y' 'n'rootopen.com
linux命令:yes | tr 'y' 'n' 'n' 'y' tr | yes yes | tr 'y' 'n'rootopen.com
2018-02-09 12:24:48

linux命令:yes n n yes yes nrootopen.com
linux命令:yes n n yes yes nrootopen.com
2018-01-19 04:50:48

linux命令:yes "$(seq 1 255)" | while read i; do printf "\x1b[48;5;${i}m\n"; sleep .01; done done .01; sleep "\x1b[48;5;${i}m\n"; printf do i; read while | 255)" 1 "$(seq yes yes "$(seq 1 255)" | while read i; do printf "\x1b[48;5;${i}m\n"; sleep .01; donerootopen.com
linux命令:yes "$(seq 1 255)" | while read i; do printf "\x1b[48;5;${i}m\n"; sleep .01; done done .01; sleep "\x1b[48;5;${i}m\n"; printf do i; read while | 255)" 1 "$(seq yes yes "$(seq 1 255)" | while read i; do printf "\x1b[48;5;${i}m\n"; sleep .01; donerootopen.com
2018-05-18 07:49:48

linux命令:yes | pv | ssh $host "cat > /dev/null" /dev/null" > "cat $host ssh | pv | yes yes | pv | ssh $host "cat > /dev/null"rootopen.com
linux命令:yes | pv | ssh $host "cat > /dev/null" /dev/null" > "cat $host ssh | pv | yes yes | pv | ssh $host "cat > /dev/null"rootopen.com
2018-05-10 03:12:48

linux命令:yes|for x in one two three; do echo result - $x; done done $x; - result echo do three; two one in x yes|for yes|for x in one two three; do echo result - $x; donerootopen.com
linux命令:yes|for x in one two three; do echo result - $x; done done $x; - result echo do three; two one in x yes|for yes|for x in one two three; do echo result - $x; donerootopen.com
2018-05-19 06:43:48

linux命令:yes n | cp -p -i -r <src> <dest> <dest> <src> -r -i -p cp | n yes yes n | cp -p -i -r <src> <dest>rootopen.com
linux命令:yes n | cp -p -i -r <src> <dest> <dest> <src> -r -i -p cp | n yes yes n | cp -p -i -r <src> <dest>rootopen.com
2018-03-04 18:04:48

linux命令:yes '' | head -n100 -n100 head | '' yes yes '' | head -n100rootopen.com
linux命令:yes '' | head -n100 -n100 head | '' yes yes '' | head -n100rootopen.com
2018-06-06 01:09:48

linux命令:yes n | cp something toSomeWhereElse toSomeWhereElse something cp | n yes yes n | cp something toSomeWhereElserootopen.com
linux命令:yes n | cp something toSomeWhereElse toSomeWhereElse something cp | n yes yes n | cp something toSomeWhereElserootopen.com
2018-05-15 01:41:48

linux命令:yes "echo -ne '\r'\`date\`;sleep 1" | sh sh | 1" '\r'\`date\`;sleep -ne "echo yes yes "echo -ne '\r'\`date\`;sleep 1" | shrootopen.com
linux命令:yes "echo -ne '\r'\`date\`;sleep 1" | sh sh | 1" '\r'\`date\`;sleep -ne "echo yes yes "echo -ne '\r'\`date\`;sleep 1" | shrootopen.com
2018-03-29 07:23:48

linux命令:yes 1 | fdupes -rd $folder $folder -rd fdupes | 1 yes yes 1 | fdupes -rd $folderrootopen.com
linux命令:yes 1 | fdupes -rd $folder $folder -rd fdupes | 1 yes yes 1 | fdupes -rd $folderrootopen.com
2018-03-06 09:02:48

linux命令:yes "$(seq 232 255;seq 254 -1 233)" | while read i; do printf "\x1b[48;5;${i}m\n"; sleep .01; done done .01; sleep "\x1b[48;5;${i}m\n"; printf do i; read while | 233)" -1 254 255;seq 232 "$(seq yes yes "$(seq 232 255;seq 254 -1 233)" | while read i; do printf "\x1b[48;5;${i}m\n"; sleep .01; donerootopen.com
linux命令:yes "$(seq 232 255;seq 254 -1 233)" | while read i; do printf "\x1b[48;5;${i}m\n"; sleep .01; done done .01; sleep "\x1b[48;5;${i}m\n"; printf do i; read while | 233)" -1 254 255;seq 232 "$(seq yes yes "$(seq 232 255;seq 254 -1 233)" | while read i; do printf "\x1b[48;5;${i}m\n"; sleep .01; donerootopen.com
2018-04-23 08:10:48

linux命令:yes "" | cat -n | awk '{print "S=`echo All work and no play makes Jack a dull boy. | cut -c",($1 - 1) % 43 + 1 "`;echo -n \"$S\";seq 500000 > /dev/null"}'| bash bash /dev/null"}'| > 500000 \"$S\";seq -n "`;echo 1 + 43 % 1) - -c",($1 cut | boy. dull a Jack makes play no and work All "S=`echo '{print awk | -n cat | "" yes yes "" | cat -n | awk '{print "S=`echo All work and no play makes Jack a dull boy. | cut -c",($1 - 1) % 43 + 1 "`;echo -n \"$S\";seq 500000 > /dev/null"}'| bashrootopen.com
linux命令:yes "" | cat -n | awk '{print "S=`echo All work and no play makes Jack a dull boy. | cut -c",($1 - 1) % 43 + 1 "`;echo -n \"$S\";seq 500000 > /dev/null"}'| bash bash /dev/null"}'| > 500000 \"$S\";seq -n "`;echo 1 + 43 % 1) - -c",($1 cut | boy. dull a Jack makes play no and work All "S=`echo '{print awk | -n cat | "" yes yes "" | cat -n | awk '{print "S=`echo All work and no play makes Jack a dull boy. | cut -c",($1 - 1) % 43 + 1 "`;echo -n \"$S\";seq 500000 > /dev/null"}'| bashrootopen.com
2018-05-03 20:37:48

linux命令:yes | !! !! | yes yes | !!rootopen.com
linux命令:yes | !! !! | yes yes | !!rootopen.com
2018-03-08 18:11:48

linux命令:yes 'c=(" " " " " " 0 1); printf "${c[RANDOM%5]}"' | bash bash | "${c[RANDOM%5]}"' printf 1); 0 " " " " " 'c=(" yes yes 'c=(" " " " " " 0 1); printf "${c[RANDOM%5]}"' | bashrootopen.com
linux命令:yes 'c=(" " " " " " 0 1); printf "${c[RANDOM%5]}"' | bash bash | "${c[RANDOM%5]}"' printf 1); 0 " " " " " 'c=(" yes yes 'c=(" " " " " " 0 1); printf "${c[RANDOM%5]}"' | bashrootopen.com
2018-05-27 22:22:48

linux命令:yes 'echo $(( RANDOM%100+1 )); sleep 5' | bash bash | 5' sleep )); RANDOM%100+1 $(( 'echo yes yes 'echo $(( RANDOM%100+1 )); sleep 5' | bashrootopen.com
linux命令:yes 'echo $(( RANDOM%100+1 )); sleep 5' | bash bash | 5' sleep )); RANDOM%100+1 $(( 'echo yes yes 'echo $(( RANDOM%100+1 )); sleep 5' | bashrootopen.com
2018-01-18 02:05:48

Linux的Bash命令行(A-Z排序)