开发者

shell script to capture keyboard activities

开发者 https://www.devze.com 2023-01-15 13:18 出处:网络
How to capture all keyboard strokes using shell script .Is there any command that i开发者_Python百科s related to keyboard activities.If you would like to log all input and output, you can use the scri

How to capture all keyboard strokes using shell script .Is there any command that i开发者_Python百科s related to keyboard activities.


If you would like to log all input and output, you can use the script command.

$ script transcript.txt
Script started, file is transcript.txt
$ echo 'Hello, world!'
Hello, world!
$ exit
Script done, file is transcript.txt
$ cat transcript.txt 
Script started on Thu 09 Sep 2010 03:06:56 PM EDT
$ echo 'Hello, world!'
Hello, world!
$ exit

Script done on Thu 09 Sep 2010 03:07:06 PM EDT


Check out the trap command.

For example, type in your console :

trap "echo \"Arrrrggghhhh\"" INT

Now press Ctrl + C - fun fun :)

0

精彩评论

暂无评论...
验证码 换一张
取 消