Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What is the purpose of the following command?

sudo echo t > /proc/sysrq-trigger

I run it, but I can see no difference in the magic key and its output at dmesg. Trigger suggests me that the databases of sysrq are involved in the process.

share|improve this question
I would argue that's a pretty obscure question for a beginner ;-) – DaveParillo Dec 3 '09 at 0:53
up vote 7 down vote accepted

according to this site - red hat manual -> proc-sysrq-trigger - you can use this to remotly (for example in an ssh session) execute the magic system request keys.

it makes sense because otherwise, if you have to perform such an task and you're not in reach for the server or the server has no keyboard attached, you can't trigger system request keys.

your example does not work because of different problems.

  • according to this site you have to set "/proc/sys/kernel/sysrq" to something other than 0. you have to search the manuals for the right value. then you are able to echo something into "/proc/sysrq-trigger".

  • you have to be root for this. "sudo echo SOMETHING > /SOMEWHERE" does not work because of the output redirection ">".

you have to do this like the examples on this site - a full example would be:

su -
echo 1 > /proc/sys/kernel/sysrq
echo "t" > /proc/sysrq-trigger


echo 1 | sudo tee -a /proc/sys/kernel/sysrq
echo "t" | sudo tee -a /proc/sysrq-trigger

After i wrote all this i catched probably another issue of your test :). if you execute for example the "t" sysrq key over an remote session or for example an xterm you can't see the output because sysrq output goes to the "real" console. issue dmesg to see the output!

share|improve this answer
@Masi: ups, forget about the last paragraph. while it is true it maybe doesn't apply to you because you wrote that you checked dmesg. --fin – fin Dec 2 '09 at 22:19
this also works, and may be cleaner than your examples: sudo sh -c 'echo 1 > /proc/sys/kernel/sysrq ; echo "t" > /proc/sysrq-trigger' – quack quixote Dec 2 '09 at 23:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .