2

I read at multiple places (e.g. here http://elinux.org/Debugging_by_printing), that you can change the console log level by echoing an integer to /proc/sys/kernel/printk. If that worked shouldn't the first integer have changed to 5 below?

[root@localhost printk]# cat /proc/sys/kernel/printk
4   4   1   7
[root@localhost printk]# echo 5>/proc/sys/kernel/printk

[root@localhost printk]# cat /proc/sys/kernel/printk
4   4   1   7

I tried this on multiple systems and it didn't change on any of them!

  • 6
    Ouch! You must leave a space between a number and > or the shell will redirect that file descriptor. Use echo 5 >/proc/sys/kernel/printk. Or dmesg -n 5. – meuh Jul 7 '15 at 7:14
  • you're right. that works solves the problem. thanks! – Lavya Jul 7 '15 at 7:32
  • sudo sh -c 'echo 8 > /proc/sys/kernel/printk' – debug Mar 26 at 9:39
  • @debug Note that the user is already root. – Kusalananda Apr 17 at 10:39
0

Moved comment to answer.

You must leave a space between a number and > or the shell will redirect that file descriptor. Use echo 5 >/proc/sys/kernel/printk. Or dmesg -n 5.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.