Removing and creating files on UNIX/Linux and using the shred command.

The shred command on Linux is the perfect way to remove files securely from your Linux system. With a large amount of iterations, it will ensure that it is very difficult to get the data back. the -u parameter will delete the file after the overwriting process.

neo@deusexmachina:~$ shred -n 20 -u gegl-0.2.0.tar.bz2

To create a file on Linux, the touch command may be used. if you type touch myfile.txt it will create an empty file that you may then fill with text. Or this command: echo “” > myfile.txt. below is the most hackish way to create an empty file that you may then fill with text. Reading from /dev/null for once…

neo@deusexmachina:~/Desktop$ dd if=/dev/null bs=1 of=myfile.txt
0+0 records in
0+0 records out
0 bytes (0 B) copied, 1.2069e-05 s, 0.0 kB/s
neo@deusexmachina:~/Desktop$ ls myfile.txt 
-rw-r--r-- 1 neo neo 0  12-04-12 09:15 pm myfile.txt

That is why Linux is so cool, the fact that everything under /proc and /dev is a file and can be manipulated as a file can. That is one of the main strengths of a UNIX and Linux operating system. And the Macintosh operating system as well, because that runs on top of the Darwin UNIX OS.

Of course the rm command on UNIX/Linux is easy to use, the rm –no-preserve-root -rf / command is famous for being the one command you do not want to execute as the root user. But the rm -f command is perfect for removing files. Just be cautious when using the rm -rf command and double check the command you have typed and use the pwd command to see where you are before executing it.

About

I am a computer enthusiast that has always been interested in maintaining and upgrading computer hardware. I was born on a farm and lived there for 13 years before moving into town. I was always interested in technology and my father always gave me good encouragement for developing my knowledge and interest in tinkering with computers. He was using a computer on the farm but that was in the very late 80`s and late 90`s. Seeing what a computer could do always fascinated me and then I knew that is what I wanted to do. The first time I used Linux was Red Hat 6.2 installed off a single CDROM and I was amazed that you did not need to install any more drivers on my old Intel Celeron machine to be able to enjoy a nice 24BPP desktop and use the GIMP to edit photos and enjoy playing the old Linux games like Xbill. Then a while later I tried Mandrake Linux 9.2 and I was hooked. It came with so much software and was very easy to use as well. Then Mandrake Linux 10 and on through FreeBSD, Debian 3.0, Debian 3.1 Suse Linux 9.2, Suse 10 and onto the Ubuntu distributions although I am using Fedora Core 15 and the Gnome 3 desktop at the moment.

Tagged with: , , , , , , ,
Posted in Debian-Testing
One comment on “Removing and creating files on UNIX/Linux and using the shred command.

Leave a Reply

Plugin from the creators of Brindes :: More at Plulz Wordpress Plugins