昨天,今天,明天,每天的每天,你是否都多懂得一点点...

星期日, 十月 14, 2018

The Linux timeout command

Sometimes, you may want to run some network command which may take long time to run. If you want to cancel the command which runs too long, you can use the timeout command. 

I use the MPV command to collection some live stream info. The command may stuck when testing a bad url. The timeout command comes handy here. 

timeout -k 60 60 mpv --no-video --length=0 --network-timeout=10 "http://edge.music-choice-vc-chaina1.top.comcast.net/VideoChannels/VC-MC128/playlist.m3u8" | grep "Playing\|Video" 


没有评论:

其它博客地址

此博客的同步博客地址: http://fengnz.wordpress.com
这里进入我的MSN SPACE.