press "ctrl+c". Thats how you stop a program running from the terminal.
you could also open "system guard" and close the application from there.
you could also just close the terminal window.
run "sync" command first before doing anything.
"cat" command just read stuff, it doesnt write and hence cant damage data on the device.