how to delete a file permanently from computer

how to delete a file permanently frm computer?

cd ./directory
rm -f filename
# or
rm -f ./directory/filename

what will exactly do?

and wat is the difference btw shift+delete and above command?
plz rpl
thanks

shift+del can only used with GUI
"rm -f" is used with CUI

read the manual page
"man rm"

UNIX has a system call - unlink()

rm, C library calls like remove() - all use this system call to delete a file. So the best answer to your question is: anything that uses the unlink() call removes a file permanently.

Plus, in base UNIX all file deletions are permanent, there is no recycle bin, there is no undelete. Some GUI's may provide a "recycle bin" to keep Windows users happy. But the files are just moved not deleted.

Just be like oscar the grouch or maybe even the cookie monster and devour that file..

shred!

If you do not want your hacker parents to find your porn..

shred --force --zero --remove --verbose filename.txt

Yeah.. or I guess you could do chattr the file with the 's' attribute (secure deletion).

chattr +s filename

READ the man pages/info pages for each command before even thinking about using them :slight_smile:

A file is not deleted until it has been overwritten on the disk (at least 3 times) with other data. Otherwise, the information still exists on the system, its space on the disk is simply flagged as available by the OS. Over time, the contents of the file are overwritten by other applications, but the time interval is unpredictable.

To ensure that information is destroyed and cannot be accessed via forensic methods, you simply rewind the file and fill it with garbage and close it. Then open, write garbage, close. It is necessary to ensure that the actual disk sectors that map to the file are written to, not simply the disk cache in memory.

Unless you are working for a security agency, financial institution or some such, simply deleting the file should be enough.

There are software packages out there that will wipe a disk clean, but if you are discarding a computer and you have sensitive information on a disk, removing the drive(s) and taking a sledgehammer to it also works.