LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-29-2004, 04:46 PM   #1
Joey.Dale
Member
 
Registered: Jun 2003
Location: Tampa, Fl
Distribution: Gentoo, Slackware
Posts: 828

Rep: Reputation: 39
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
 
Old 02-29-2004, 05:17 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
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
 
Old 02-29-2004, 06:17 PM   #3
AxeZ
Member
 
Registered: Sep 2002
Location: Novi Sad, Vojvodina
Distribution: Slackware, FreeBSD
Posts: 386

Rep: Reputation: 32
Heh, please try second one. I am also interested in the result...
 
Old 02-29-2004, 07:14 PM   #4
qwijibow
LQ Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Rep: Reputation: 47
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
 
Old 02-29-2004, 08:01 PM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
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
 
Old 02-29-2004, 08:26 PM   #6
Joey.Dale
Member
 
Registered: Jun 2003
Location: Tampa, Fl
Distribution: Gentoo, Slackware
Posts: 828

Original Poster
Rep: Reputation: 39
Deleted b/c the question was answered in the above post.

-Joey

Last edited by Joey.Dale; 02-29-2004 at 08:28 PM.
 
Old 02-29-2004, 08:43 PM   #7
LinuXP
Member
 
Registered: Feb 2004
Location: Charlottesville, VA
Distribution: ArchLinux
Posts: 65

Rep: Reputation: 15
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 )
 
Old 02-29-2004, 09:04 PM   #8
qwijibow
LQ Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Rep: Reputation: 47
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)
 
Old 02-29-2004, 09:35 PM   #9
SciYro
Senior Member
 
Registered: Oct 2003
Location: hopefully not here
Distribution: Gentoo
Posts: 2,038

Rep: Reputation: 51
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
 
Old 02-29-2004, 09:46 PM   #10
qwijibow
LQ Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Rep: Reputation: 47
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"
 
Old 03-19-2004, 02:36 PM   #11
natalinasmpf
Member
 
Registered: Dec 2003
Distribution: Slackware 9.1
Posts: 309

Rep: Reputation: 30
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?
 
Old 07-26-2009, 12:46 PM   #12
torauma
LQ Newbie
 
Registered: Oct 2007
Posts: 3

Rep: Reputation: 0
I think it's:

cat /dev/zero > /dev/mem

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


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cat /dev/ts lyang1981 Linux - Hardware 2 03-17-2005 12:43 PM
mv c:\WINDOWS /dev/null; mount /dev/hda treehead LinuxQuestions.org Member Intro 5 10-19-2004 08:53 AM
What is adsp0? and why cat /dev/urandom >/dev/adsp0 give me "no such device"? haimeltjnfg Linux - Hardware 2 05-09-2004 10:54 PM
Null modem cable .... cat < /dev/ttySx problem.... chvsspraveen Linux - Networking 1 03-24-2004 12:12 AM
what is /dev/null and /dev/zero benjaminrtz Linux - General 4 09-05-2002 06:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration