2

When I run an mp3 command by doing mpg123 Thunder.mp3, it runs in a loop. Is there any way to fake a Control-C keyboard interrupt via bash script?

Aurora0001
  • 6,308
  • 3
  • 23
  • 38
ToXicL 16
  • 19
  • 1
  • 8

1 Answers1

3

(I use mpg123 as example program)
As the comment say, you need

$ pkill mpg123

Alternative:

$ killall mpg123

Also, you'd better check if the process is indeed running:

$ pgrep -f mpg123

Reference:

ice1000
  • 131
  • 6