简单的pomodoro

简单的pomodoro
.

0

linux命令:while true; do sleep $((40 * 60)); echo "Fuck away for some time"; sleep $((3 * 60)); done & & done 60)); * $((3 sleep time"; some for away "Fuck echo 60)); * $((40 sleep do true; while while true; do sleep $((40 * 60)); echo "Fuck away for some time"; sleep $((3 * 60)); done &rootopen.com
linux命令:while true; do sleep $((40 * 60)); echo "Fuck away for some time"; sleep $((3 * 60)); done & & done 60)); * $((3 sleep time"; some for away "Fuck echo 60)); * $((40 sleep do true; while while true; do sleep $((40 * 60)); echo "Fuck away for some time"; sleep $((3 * 60)); done &rootopen.com
usvy 2018-01-28 20:07:48
输出
linux命令:while 详解

评论

相关推荐

ping -c1 host 只发送一次ping并退出,但成功或错误。 while 将继续运行,直到ping成功 当ping成功时,while循环将结束,并且将发送一封电子邮件,其中包含日期作为消息

linux命令:while ! ping -c1 the_host_down; do sleep 1; done && date | mail -s 'the host is back!' me@example.com me@example.com back!' is host 'the -s mail | date && done 1; sleep do the_host_down; -c1 ping ! while while ! ping -c1 the_host_down; do sleep 1; done && date | mail -s 'the host is back!' me@example.comrootopen.com
linux命令:while ! ping -c1 the_host_down; do sleep 1; done && date | mail -s 'the host is back!' me@example.com me@example.com back!' is host 'the -s mail | date && done 1; sleep do the_host_down; -c1 ping ! while while ! ping -c1 the_host_down; do sleep 1; done && date | mail -s 'the host is back!' me@example.comrootopen.com
.

此代码段允许逐行处理任何bash命令的输出。

linux命令:while read -r line; do echo $line; done < <(YOUR COMMAND HERE); HERE); COMMAND <(YOUR < done $line; echo do line; -r read while while read -r line; do echo $line; done < <(YOUR COMMAND HERE);rootopen.com
linux命令:while read -r line; do echo $line; done < <(YOUR COMMAND HERE); HERE); COMMAND <(YOUR < done $line; echo do line; -r read while while read -r line; do echo $line; done < <(YOUR COMMAND HERE);rootopen.com
.

这将打开光盘设备并在一个循环中关闭它

linux命令:while true; do eject /dev/cdrom && eject -t /dev/cdrom; done done /dev/cdrom; -t eject && /dev/cdrom eject do true; while while true; do eject /dev/cdrom && eject -t /dev/cdrom; donerootopen.com
linux命令:while true; do eject /dev/cdrom && eject -t /dev/cdrom; done done /dev/cdrom; -t eject && /dev/cdrom eject do true; while while true; do eject /dev/cdrom && eject -t /dev/cdrom; donerootopen.com
.

添加@ mail.com列表的每一行

linux命令:while read line; do echo -e "$line@mail.com"; done < list.txt list.txt < done "$line@mail.com"; -e echo do line; read while while read line; do echo -e "$line@mail.com"; done < list.txtrootopen.com
linux命令:while read line; do echo -e "$line@mail.com"; done < list.txt list.txt < done "$line@mail.com"; -e echo do line; read while while read line; do echo -e "$line@mail.com"; done < list.txtrootopen.com
.

linux命令:while [ 1 ]; do date; ls -l /path/to/dir; sleep 1; done done 1; sleep /path/to/dir; -l ls date; do ]; 1 [ while while [ 1 ]; do date; ls -l /path/to/dir; sleep 1; donerootopen.com
linux命令:while [ 1 ]; do date; ls -l /path/to/dir; sleep 1; done done 1; sleep /path/to/dir; -l ls date; do ]; 1 [ while while [ 1 ]; do date; ls -l /path/to/dir; sleep 1; donerootopen.com
.

linux命令:while [ ! -f /tmp/stop ]; do ssh -o ExitOnForwardFailure=yes -R 2222:localhost:22 target "while nc -zv localhost 2222; do sleep 5; done"; sleep 5;done 5;done sleep done"; 5; sleep do 2222; localhost -zv nc "while target 2222:localhost:22 -R ExitOnForwardFailure=yes -o ssh do ]; /tmp/stop -f ! [ while while [ ! -f /tmp/stop ]; do ssh -o ExitOnForwardFailure=yes -R 2222:localhost:22 target "while nc -zv localhost 2222; do sleep 5; done"; sleep 5;donerootopen.com
linux命令:while [ ! -f /tmp/stop ]; do ssh -o ExitOnForwardFailure=yes -R 2222:localhost:22 target "while nc -zv localhost 2222; do sleep 5; done"; sleep 5;done 5;done sleep done"; 5; sleep do 2222; localhost -zv nc "while target 2222:localhost:22 -R ExitOnForwardFailure=yes -o ssh do ]; /tmp/stop -f ! [ while while [ ! -f /tmp/stop ]; do ssh -o ExitOnForwardFailure=yes -R 2222:localhost:22 target "while nc -zv localhost 2222; do sleep 5; done"; sleep 5;donerootopen.com
.

看着你生命中的秒钟 - 取代YYYY-MM-DD HH:MM:SS w /你的生日。

linux命令:while [ 0 ]; do expr 2365200000 \- `date +%s` \- `date --date "YYYY-mm-dd HH:MM:ss" +%s`; sleep 1; clear; done done clear; 1; sleep +%s`; HH:MM:ss" "YYYY-mm-dd --date `date \- +%s` `date \- 2365200000 expr do ]; 0 [ while while [ 0 ]; do expr 2365200000 \- `date +%s` \- `date --date "YYYY-mm-dd HH:MM:ss" +%s`; sleep 1; clear; donerootopen.com
linux命令:while [ 0 ]; do expr 2365200000 \- `date +%s` \- `date --date "YYYY-mm-dd HH:MM:ss" +%s`; sleep 1; clear; done done clear; 1; sleep +%s`; HH:MM:ss" "YYYY-mm-dd --date `date \- +%s` `date \- 2365200000 expr do ]; 0 [ while while [ 0 ]; do expr 2365200000 \- `date +%s` \- `date --date "YYYY-mm-dd HH:MM:ss" +%s`; sleep 1; clear; donerootopen.com
.

加载你的CPU,为每个CPU / CORE运行一个实例。

linux命令:while true; do /bin/true; done done /bin/true; do true; while while true; do /bin/true; donerootopen.com
linux命令:while true; do /bin/true; done done /bin/true; do true; while while true; do /bin/true; donerootopen.com
.

升级的Debian / Ubuntu /等。系统可能会有许多“孤立”包,它们只占用空间,可以通过“deborphan”命令找到它们。虽然你可以做“dpkg --purge $(deborphan)”,但清除孤儿的行为通常会造成更多的孤儿。这个命令将一次性完成。

linux命令:while [ $(deborphan | wc -l) -gt 0 ]; do dpkg --purge $(deborphan); done done $(deborphan); --purge dpkg do ]; 0 -gt -l) wc | $(deborphan [ while while [ $(deborphan | wc -l) -gt 0 ]; do dpkg --purge $(deborphan); donerootopen.com
linux命令:while [ $(deborphan | wc -l) -gt 0 ]; do dpkg --purge $(deborphan); done done $(deborphan); --purge dpkg do ]; 0 -gt -l) wc | $(deborphan [ while while [ $(deborphan | wc -l) -gt 0 ]; do dpkg --purge $(deborphan); donerootopen.com
.

在bash和zsh中的$ [...]块会让你做math.echo $ [6 * 7]这与使用$((...))相同,这也可以在ksh中使用。当然,这是一个简单的,愚蠢的包装,不允许浮点。

linux命令:while true; do read i; echo $[$i]; done done $[$i]; echo i; read do true; while while true; do read i; echo $[$i]; donerootopen.com
linux命令:while true; do read i; echo $[$i]; done done $[$i]; echo i; read do true; while while true; do read i; echo $[$i]; donerootopen.com
.

任何HTTP请求到指定端口上的机器将被重定向到http://www.whatevs.com ...快速,肮脏,适用于网站w /

linux命令:while [ 0 ]; do echo -e "HTTP/1.1 302 Found\nLocation: http://www.whatevs.com/index.html" | nc -vvvv -l -p 80; done done 80; -p -l -vvvv nc | http://www.whatevs.com/index.html" Found\nLocation: 302 "HTTP/1.1 -e echo do ]; 0 [ while while [ 0 ]; do echo -e "HTTP/1.1 302 Found\nLocation: http://www.whatevs.com/index.html" | nc -vvvv -l -p 80; donerootopen.com
linux命令:while [ 0 ]; do echo -e "HTTP/1.1 302 Found\nLocation: http://www.whatevs.com/index.html" | nc -vvvv -l -p 80; done done 80; -p -l -vvvv nc | http://www.whatevs.com/index.html" Found\nLocation: 302 "HTTP/1.1 -e echo do ]; 0 [ while while [ 0 ]; do echo -e "HTTP/1.1 302 Found\nLocation: http://www.whatevs.com/index.html" | nc -vvvv -l -p 80; donerootopen.com
.

请参阅示例输出

linux命令:while read line; do echo "$(date),$(hostname),$line"; done < somefile.txt somefile.txt < done "$(date),$(hostname),$line"; echo do line; read while while read line; do echo "$(date),$(hostname),$line"; done < somefile.txtrootopen.com
linux命令:while read line; do echo "$(date),$(hostname),$line"; done < somefile.txt somefile.txt < done "$(date),$(hostname),$line"; echo do line; read while while read line; do echo "$(date),$(hostname),$line"; done < somefile.txtrootopen.com
.

抽出喋喋不休,定期运行这个脚本来听你的twitter时间线。这是一个粗略的第一次剪辑,使用了我发现的几个cli剪辑。没有办法不读那些已经阅读过的东西。虽然我认为这可能会违反日内瓦公约UPDUPATE的几个要点 - 增加一个循环,只读取前6个twits,并且每5分钟完成一次,这也可以轻松地放入循环中。

linux命令:while [ 1 ]; do curl -s -u username:password http://twitter.com/statuses/friends_timeline.rss|grep title|sed -ne 's/<\/*title>//gp' | head -n 6 |festival --tts; sleep 300;done 300;done sleep --tts; |festival 6 -n head | 's/<\/*title>//gp' -ne title|sed http://twitter.com/statuses/friends_timeline.rss|grep username:password -u -s curl do ]; 1 [ while while [ 1 ]; do curl -s -u username:password http://twitter.com/statuses/friends_timeline.rss|grep title|sed -ne 's/<\/*title>//gp' | head -n 6 |festival --tts; sleep 300;donerootopen.com
linux命令:while [ 1 ]; do curl -s -u username:password http://twitter.com/statuses/friends_timeline.rss|grep title|sed -ne 's/<\/*title>//gp' | head -n 6 |festival --tts; sleep 300;done 300;done sleep --tts; |festival 6 -n head | 's/<\/*title>//gp' -ne title|sed http://twitter.com/statuses/friends_timeline.rss|grep username:password -u -s curl do ]; 1 [ while while [ 1 ]; do curl -s -u username:password http://twitter.com/statuses/friends_timeline.rss|grep title|sed -ne 's/<\/*title>//gp' | head -n 6 |festival --tts; sleep 300;donerootopen.com
.

方便,如果你只有一个控制台会话或tty。

linux命令:while true; do date; sleep 1; done done 1; sleep date; do true; while while true; do date; sleep 1; donerootopen.com
linux命令:while true; do date; sleep 1; done done 1; sleep date; do true; while while true; do date; sleep 1; donerootopen.com
.

请参阅man vmstat以获取有关统计信息的信息。没有时间戳记,这会执行相同的操作:vmstat 5

linux命令:while [ 1 ]; do echo -n "`date +%F_%T`" ; vmstat 1 2 | tail -1 ; sleep 4; done done 4; sleep ; -1 tail | 2 1 vmstat ; +%F_%T`" "`date -n echo do ]; 1 [ while while [ 1 ]; do echo -n "`date +%F_%T`" ; vmstat 1 2 | tail -1 ; sleep 4; donerootopen.com
linux命令:while [ 1 ]; do echo -n "`date +%F_%T`" ; vmstat 1 2 | tail -1 ; sleep 4; done done 4; sleep ; -1 tail | 2 1 vmstat ; +%F_%T`" "`date -n echo do ]; 1 [ while while [ 1 ]; do echo -n "`date +%F_%T`" ; vmstat 1 2 | tail -1 ; sleep 4; donerootopen.com
.

我编写了一个名为bootstrap.py的脚本来删除数据库,然后使用初始值加载一个新的数据库。有了这个单行shell循环,当我需要进行模式更改时(这经常发生在某些项目的早期阶段),我点击ctrl-C停止正在运行的Django服务器,然后观看bootstrap.py做它的事情,然后观察服务器重新启动。

linux命令:while true ; do scripts/bootstrap.py ; ./manage.py runserver ; done done ; runserver ./manage.py ; scripts/bootstrap.py do ; true while while true ; do scripts/bootstrap.py ; ./manage.py runserver ; donerootopen.com
linux命令:while true ; do scripts/bootstrap.py ; ./manage.py runserver ; done done ; runserver ./manage.py ; scripts/bootstrap.py do ; true while while true ; do scripts/bootstrap.py ; ./manage.py runserver ; donerootopen.com
.

linux命令:while true; do X=$Y; sleep 1; Y=$(ifconfig eth0|grep RX\ bytes|awk '{ print $2 }'|cut -d : -f 2); echo "$(( Y-X )) bps"; done done bps"; )) Y-X "$(( echo 2); -f : -d }'|cut $2 print '{ bytes|awk RX\ eth0|grep Y=$(ifconfig 1; sleep X=$Y; do true; while while true; do X=$Y; sleep 1; Y=$(ifconfig eth0|grep RX\ bytes|awk '{ print $2 }'|cut -d : -f 2); echo "$(( Y-X )) bps"; donerootopen.com
linux命令:while true; do X=$Y; sleep 1; Y=$(ifconfig eth0|grep RX\ bytes|awk '{ print $2 }'|cut -d : -f 2); echo "$(( Y-X )) bps"; done done bps"; )) Y-X "$(( echo 2); -f : -d }'|cut $2 print '{ bytes|awk RX\ eth0|grep Y=$(ifconfig 1; sleep X=$Y; do true; while while true; do X=$Y; sleep 1; Y=$(ifconfig eth0|grep RX\ bytes|awk '{ print $2 }'|cut -d : -f 2); echo "$(( Y-X )) bps"; donerootopen.com
.

ping服务器每秒一次,当服务器无法访问时发出嘟嘟声。基本上与以下情况相反:ping -a服务器或ip.com,当服务器可达时会发出蜂鸣声。您也可以用任何命令替代蜂鸣声,这会使此一个强大的选择平-a:虽然是真的; do [“$(ping -c1W1w1 server-or-ip.com 2> / dev / null | awk'/ received / {print $ 4}')”= 1] && date ||回声'服务器已关闭!';睡1;这样会每秒输出日期和时间,直到ping失败,在这种情况下,它会回显。注意:需要嘟嘟声包。可能需要以root身份运行(嘟嘟声使用系统扬声器)在Ubuntu上测试过,没有发出嘟嘟声的盒子... sudo apt-get install beep

linux命令:while true; do [ "$(ping -c1W1w1 server-or-ip.com | awk '/received/ {print $4}')" != 1 ] && beep; sleep 1; done done 1; sleep beep; && ] 1 != $4}')" {print '/received/ awk | server-or-ip.com -c1W1w1 "$(ping [ do true; while while true; do [ "$(ping -c1W1w1 server-or-ip.com | awk '/received/ {print $4}')" != 1 ] && beep; sleep 1; donerootopen.com
linux命令:while true; do [ "$(ping -c1W1w1 server-or-ip.com | awk '/received/ {print $4}')" != 1 ] && beep; sleep 1; done done 1; sleep beep; && ] 1 != $4}')" {print '/received/ awk | server-or-ip.com -c1W1w1 "$(ping [ do true; while while true; do [ "$(ping -c1W1w1 server-or-ip.com | awk '/received/ {print $4}')" != 1 ] && beep; sleep 1; donerootopen.com
.

你可以使用它来循环任何命令来定期查看output.while true;做[你的命令在这里];睡眠[秒数];完成;或者,你可以把它放在一个简单的shell脚本中以节省输入!#/!bin / bashwhile true;做$ 1;睡2美元; done; /path/to/script.sh“ifconfig eth0 | grep'inet addr:'”60

linux命令:while true; do ifconfig eth0 | grep "inet addr:"; sleep 60; done; done; 60; sleep addr:"; "inet grep | eth0 ifconfig do true; while while true; do ifconfig eth0 | grep "inet addr:"; sleep 60; done;rootopen.com
linux命令:while true; do ifconfig eth0 | grep "inet addr:"; sleep 60; done; done; 60; sleep addr:"; "inet grep | eth0 ifconfig do true; while while true; do ifconfig eth0 | grep "inet addr:"; sleep 60; done;rootopen.com
.

每隔30分钟(或者你喜欢的长度,我想应该是)每隔30分钟更换一张墙纸到一个目录和子目录中随机选择的图像。请记住,如果其他人有权访问图像目录,则不安全。

linux命令:while :; do xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path -s "$(find <image-directory> -type f -iregex '.*\.\(bmp\|gif\|jpg\|png\)$' | sort -R | head -1)"; sleep 30m; done done 30m; sleep -1)"; head | -R sort | '.*\.\(bmp\|gif\|jpg\|png\)$' -iregex f -type <image-directory> "$(find -s /backdrop/screen0/monitor0/image-path -p xfce4-desktop -c xfconf-query do :; while while :; do xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path -s "$(find <image-directory> -type f -iregex '.*\.\(bmp\|gif\|jpg\|png\)$' | sort -R | head -1)"; sleep 30m; donerootopen.com
linux命令:while :; do xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path -s "$(find <image-directory> -type f -iregex '.*\.\(bmp\|gif\|jpg\|png\)$' | sort -R | head -1)"; sleep 30m; done done 30m; sleep -1)"; head | -R sort | '.*\.\(bmp\|gif\|jpg\|png\)$' -iregex f -type <image-directory> "$(find -s /backdrop/screen0/monitor0/image-path -p xfce4-desktop -c xfconf-query do :; while while :; do xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path -s "$(find <image-directory> -type f -iregex '.*\.\(bmp\|gif\|jpg\|png\)$' | sort -R | head -1)"; sleep 30m; donerootopen.com
.
共收录0条命令行
这里是记录和分享命令行的地方, 所有命令行都可以进行评论、提交替代方案.

推荐
    热门命令