how to delete a file permanently from computer


 
Thread Tools Search this Thread
Top Forums Programming how to delete a file permanently from computer
# 1  
Old 05-16-2009
how to delete a file permanently from computer

how to delete a file permanently frm computer?
# 2  
Old 05-16-2009
Code:
cd ./directory
rm -f filename
# or
rm -f ./directory/filename

# 3  
Old 05-19-2009
Quote:
Originally Posted by jim mcnamara
Code:
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
# 4  
Old 05-19-2009
shift+del can only used with GUI
"rm -f" is used with CUI
# 5  
Old 05-21-2009
read the manual page
"man rm"
# 6  
Old 05-22-2009
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.
# 7  
Old 05-22-2009
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..

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

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

Code:
chattr +s filename

READ the man pages/info pages for each command before even thinking about using them Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Ssh cat file output into a file on local computer

Hello, I'm on a remote computer by SSH. How can I get the output of "cat file" into a file on the local computer? I cannot use scp, because it's blocked. something like: ssh root@remote_maschine "cat /file" > /locale_machine/file :rolleyes: (2 Replies)
Discussion started by: borsti007
2 Replies

2. Solaris

Set autolist permanently

Hi , How to set autolist permanently in Solaris 10 (2 Replies)
Discussion started by: ankit.padhiyar
2 Replies

3. Solaris

Removal of zip file permanently

Hi Everyone, I see some peculier thing happening on my server. I have one zipped file created long back as a normal user and trying to remove it now. When i tried to remove as that particular user, i was not able to do that. So i logged in as a root user and removed that successfully. But it... (8 Replies)
Discussion started by: Sricharan21
8 Replies

4. UNIX for Dummies Questions & Answers

Replace 8th and 9th characters in file permanently

Good evening, I have a file and wish to replace the 8th and 9th characters on the first line only no matter what they are with 44 and the file permanantly changed. e.g. file example.txt before change: 123456789123456 hi how are you blah blah file example.txt after change: ... (4 Replies)
Discussion started by: GarciasMuffin
4 Replies

5. Solaris

delete routing permanently

How can I remove permanently a route from the routing table? I have the following: root@aiwutr1>netstat -rnv IRE Table: IPv4 Destination Mask Gateway Device Mxfrg Rtt Ref Flg Out In/Fwd -------------------- --------------- --------------------... (3 Replies)
Discussion started by: gianluca.p
3 Replies

6. Shell Programming and Scripting

Find and replace permanently

i have a few scripts in which i need to find string"ali1@abcd.com" and replace it with "ali@abcd.com" i used 2 below commands but none of them is permanently replacing the old string in the script s.sh perl -pi -e 's/ali1@abcd.com/ali@abcd.com/g' s.sh sed 's/ali1@abcd.com/ali@abcd.com/g'... (7 Replies)
Discussion started by: ali560045
7 Replies

7. Shell Programming and Scripting

copy file from script file to remote computer

hi, i want copy one or group of file from a computer to others, but i have some problem that do not allow me to do this. i do this by scp command like this : scp <file name> root@cpName:destinationAddress but the problem is that it do not it automatically. it means when it is connecting to... (4 Replies)
Discussion started by: MShirzadi
4 Replies

8. OS X (Apple)

Getting the External IP Address of your Computer and Storing it in a File

My computer is one of three computer on our LAN. Our router is a Time Capsule. My computer is the only of of three computers that has been assigned a static IP address on the LAN, because it runs an Apache installation. I tinker around with web development from time to time, and I wanted to be... (7 Replies)
Discussion started by: Audacitor
7 Replies

9. UNIX for Dummies Questions & Answers

numbers on permanently through .bash_profile

Hi Can anyone tell me if it is at all possible to edit ones .bash_profile, to make the setting on of line numbers (in vi/vim), permanent? I've been to a few IRC channels and people keep telling me it is more of a vi/vim thing and to use something called ".vimrc", however I heard that it is... (3 Replies)
Discussion started by: zorrokan
3 Replies

10. UNIX for Dummies Questions & Answers

how to alter the old file permanently using sed?

hi , m new to sed and awk. can anyone tell me how to alter the old file permanenetly using sed. e.g. $sed 's/cat/dog/g' old_file the above command will replace all the occrance of cat by dog in the file called old_file and by default will show the output at stdout. so is there anyway of... (2 Replies)
Discussion started by: mxms755
2 Replies
Login or Register to Ask a Question