Repeat command automatically in Linux

前端 未结 13 1684
滥情空心
滥情空心 2020-12-04 04:54

Is it possible in Linux command line to have a command repeat every n seconds?

Say, I have an import running, and I am doing

ls -l
         


        
13条回答
  •  隐瞒了意图╮
    2020-12-04 05:20

    "watch" does not allow fractions of a second in Busybox, while "sleep" does. If that matters to you, try this:

    while true; do ls -l; sleep .5; done
    

提交回复
热议问题