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 12-10-2008, 12:14 AM   #1
fedoralinuxjunkie
Member
 
Registered: Jun 2008
Location: NC
Distribution: Slackware64 15.0
Posts: 154

Rep: Reputation: 21
/dev/null questions...


Hey all. I have some random weird questions about /dev/null...

1. What happens if I were to move a file I don't want anymore to /dev/null as the root user? Does it get deleted, or just kind of float around somewhere other than it's original location?
2. Does /dev/null ever get full?
 
Old 12-10-2008, 12:29 AM   #2
FewClues
Member
 
Registered: Jul 2005
Location: Mission TX
Distribution: Ubuntu, Mint
Posts: 122

Rep: Reputation: 20
Quote:
Originally Posted by fedoralinuxjunkie View Post
Hey all. I have some random weird questions about /dev/null...

1. What happens if I were to move a file I don't want anymore to /dev/null as the root user? Does it get deleted, or just kind of float around somewhere other than it's original location?
2. Does /dev/null ever get full?
Definition: /dev/null: On UNIX, this is a virtual-file that can be written to. Data written to this file gets discarded. It is similar to the file call NUL on Windows machines. Key point: When rooting a machine, intruders will often redirect logging to /dev/null For example, the command ln -s /dev/null .bash_history will cause the system to stop logging bash commands. Culture: In the vernacular, means much the same thing as black hole. Typical usage: if you don't like what I have to say, please direct your comments to /dev/null.

Source: Hacking-Lexicon / Linux Dictionary V 0.16
http://www.tldp.org/LDP/Linux-Dictio...tml/index.html
Author: Binh Nguyen linuxfilesystem(at)yahoo(dot)com(dot)au
 
Old 12-10-2008, 01:12 AM   #3
fedoralinuxjunkie
Member
 
Registered: Jun 2008
Location: NC
Distribution: Slackware64 15.0
Posts: 154

Original Poster
Rep: Reputation: 21
Ah now I get it...so basically what your saying is if I were to do this:

Code:
sudo mv uselessfile /dev/null
I would do no harm to my system or hard drive at all?
 
Old 12-10-2008, 01:22 AM   #4
FewClues
Member
 
Registered: Jul 2005
Location: Mission TX
Distribution: Ubuntu, Mint
Posts: 122

Rep: Reputation: 20
Yes, you could do that and cause no harm to your drive at all. You could also use rm uselessfile or shred useless file

If you don't have root permission you would preceed these two commands with sudo.
 
Old 12-10-2008, 01:26 AM   #5
fedoralinuxjunkie
Member
 
Registered: Jun 2008
Location: NC
Distribution: Slackware64 15.0
Posts: 154

Original Poster
Rep: Reputation: 21
Got it. Thanks for the help
 
Old 12-10-2008, 02:25 AM   #6
Stéphane Ascoët
Member
 
Registered: Feb 2004
Location: Fleury-les-Aubrais, 120 km south of Paris
Distribution: Devuan, Debian, Mandrake, Freeduc (the one I used to work on), Slackware, MacOS X
Posts: 251

Rep: Reputation: 49
Thumbs down Warning!

Moving a file to /dev/null can replace /dev/null by the file!
 
Old 12-10-2008, 10:05 AM   #7
nflenz
Member
 
Registered: Feb 2006
Distribution: CRUX 2.4
Posts: 96

Rep: Reputation: 18
Quote:
Originally Posted by Stéphane Ascoët View Post
Moving a file to /dev/null can replace /dev/null by the file!
Correct. The null device is not a directory, so "mv uselessfile /dev/null" will overwrite /dev/null with uselessfile. The null device is mostly used to discard output you don't want. The command below will redirect errors on the console to /dev/null

Code:
$ firefox >& /dev/null
 
Old 12-10-2008, 10:34 AM   #8
fedoralinuxjunkie
Member
 
Registered: Jun 2008
Location: NC
Distribution: Slackware64 15.0
Posts: 154

Original Poster
Rep: Reputation: 21
That I did not know...Knowing that now, I'll be sure not to send anything to /dev/null except the console errors...thanks for the warning
 
  


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
What would happen if I where to cat /dev/mem > /dev/null Joey.Dale Linux - General 11 07-26-2009 12:46 PM
Startx Permission problems on /dev/null and /dev/mem on freshly compiled 2.6.22.1 Eric_Cartman Linux - Kernel 2 09-09-2007 01:42 AM
Diff Between /dev/zero & /dev/null rajaniyer123 Solaris / OpenSolaris 4 07-02-2007 06:09 AM
What is meant by " file > /dev/null 2>&1 </dev/null " attockonian Linux - Newbie 5 06-30-2006 10:51 PM
mv c:\WINDOWS /dev/null; mount /dev/hda treehead LinuxQuestions.org Member Intro 5 10-19-2004 08:53 AM

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

All times are GMT -5. The time now is 06:26 AM.

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