LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   What would happen if I where to cat /dev/mem > /dev/null (https://www.linuxquestions.org/questions/linux-general-1/what-would-happen-if-i-where-to-cat-dev-mem-dev-null-151967/)

Joey.Dale 02-29-2004 04:46 PM

What would happen if I where to cat /dev/mem > /dev/null
 
Hi all,

I was reading the "Can root harm my computer" thread and I have a quick question. What would happen if I did a cat /dev/mem > /dev/null and cat /dev/null > /dev/mem?

Thank You
-Joey

Tinkster 02-29-2004 05:17 PM

The first wouldn't do anything but eat a few
CPU cycles ... the second would probably
(if run as root) crash your box ... give it a try ;}


Cheers,
Tink

AxeZ 02-29-2004 06:17 PM

Heh, please try second one. I am also interested in the result...;)

qwijibow 02-29-2004 07:14 PM

yeah the second would do damage...
but i think its great in linux how you cannot damage the system without root....

try
delete C:/windows/System/* under windows ;)

Tinkster 02-29-2004 08:01 PM

K, I tried it ...

cat /dev/null > /dev/mem
does NOTHING as well :/ ... (as user you get
permission denied, as root nothing happens).

Wonder what
cat /dev/null > /proc/kcore
would do? :D

Cheers,
Tink

Joey.Dale 02-29-2004 08:26 PM

Deleted b/c the question was answered in the above post.

-Joey

LinuXP 02-29-2004 08:43 PM

So, has any one actually tried the second one? I'm a little bit curious myself.

In the meantime, if you have win on your machine, you can try the DOS command in my sig. (Course, I'm not liable for the results ;) )

qwijibow 02-29-2004 09:04 PM

Hey....
since cat /dev/null outputs nothing, i dont think memory is being over written...

how about cat /dev/urandom > /dev/mem
as root maybe that would skrew up your system.

cat /dev/urandom > /dev/hdb

BOOOOM
no more partiton table ;) (or anything else for that matter)

SciYro 02-29-2004 09:35 PM

ok i tryed cat /dev/random > /dev/mem all its doing is making the little lite that says when the CPU is being used blink every once in a while, but its not crashing, altho ic ant use my system as cat wont let go of my system!, ok i need to reboot as i have no way to kill cat or close cat, , thats seee what happens after reboot
note: im runing as super user (user 0, root , what name you want to use)
ok rebooted and everyhting normal, /dev/mem is still ther, every acts and looks like it should

besides making my system unusedable it did nothing to hurt it (note:, if i was able to switch terminals then i coulda probly killed cat and got outa that) so i think it was just a waste of time

qwijibow 02-29-2004 09:46 PM

okay.....

i bet you cant get out of this one.... as root

cat /dev/urandom > /dev/mouse
cat /dev/urandom > /dev/keyboard

(substitute your keyboard and mouse device)

bad thngs happen...
ive had the mouse mouving and clicking all over the scrren, secising, drag and dropping... everything...

and once the mouse opened a second terminal, and gave it focus.
then the keyboard was entering all commands...
most of which gave a "oidjfgsoindgjsb unknown command"

natalinasmpf 03-19-2004 02:36 PM

I always wondered why someone said cat /dev/null > /dev/mem would do damage that one would have to reinstall: it would just blank the RAM no? And the RAM gets reset every reboot? Unless of course someone was writing to the filesystem and had to copy it from the RAM...


What is /dev/mem actually? Does it count the swap file? Is it just the RAM or more? The BIOS or CMOS?

torauma 07-26-2009 12:46 PM

I think it's:

cat /dev/zero > /dev/mem

that would do what people are expecting /dev/null to do.


All times are GMT -5. The time now is 10:28 AM.