about rm


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers about rm
# 1  
Old 12-22-2011
about rm

i read in one of the article like if we use rm utility to delete the file it will delete only the link.By reading this i understood that it will delete the reference to that file in memory not the actual content.is it true?if so how can i delete the reference as well as content?is there any utility to restore the file cotent once i deleted?



thanks
# 2  
Old 12-22-2011
read about shred.

Code:
man shred

It is very dangerous command.
# 3  
Old 12-22-2011
about rm

so my understanding about rm is correct?is it deletes only references?are we call references in unix as links?
# 4  
Old 12-22-2011
removing files

In all file systems I know of, when you delete (no matter the command), you are simply telling the operating system to free up the blocks on the disk drive. The method for freeing up the blocks can differ, as will the methods to recover from this.

There are programs designed to specifically cleanse a disk drive of file remnants - most for the PC world. Essentially, the programs find the 'free' blocks of the disk and write random ones and zeroes to overwrite whatever was there prior.

Depending on your system, and need for security, make your own decisions regarding the security of the data. When I worked at one secure facility, we would pull the hard drives out to be destroyed separate. We brought them to a facility that had a large shredder - turning the hard drives into little bits of metal.
# 5  
Old 12-22-2011
The "rm" command deletes the file. There is no "undelete" in unix. There is no "recycle bin".
Ensure that the files appear on a recent backup before deleting them.

There are specific exceptions for Links:
If you delete a Soft Link to a file, it only deletes the Soft Link not the object file.
If there are Hard Links to a file, the last Hard Link which you delete actually deletes the file.

Be very careful, and try out commands on a training computer.


After re-reading your post. The "rm" command just removes the entry from the directory and marks the disc blocks as free. If no other program re-used the disc blocks it might be possible to retrieve the data with very sophisticated tools (which do not come with unix). If you are concerned about security, there are add-on commands to replace "rm" with a command that does wipe the disc blocks.

Last edited by methyl; 12-22-2011 at 11:59 AM..
 
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question