shred command
.............
syntax:- shred [OPTIONS] FILE [...]
Ex:-
$ echo "Sensitive data" > file
$ cat file
Sensitive data
$ shred file
$ ls file
file
$ cat file
Ò´¿(j}yãÒÒÁXp|ÄþÅJ]vìâ£íÕ!¸`ÓçÚá/é²c\§øn
cí%±0zÖTt¯É
¤~Q£_,§Àý?ÎO|Ù{>A0æä~Ë«Á@¾p^ÈÅáÜyÌ¡èÂ$®5Í^8fµ
4ÒWc@!-5üÁ%¨çN!"R
Îo8{³FI¸* \¨ç´
àÀTÛ^
WÑ8ÇkÇRá3¯çz\[ÔhB®ÙºÉ%lk @°pÅ%F ¾áDcmÃïÿfG]5Ýiû²
$ rm file
* shred a hard disk
shred /dev/sdx
illtbagu
usually i just shred -v -f -u -z if its a file, but if its a folder i cant do this, it doesnt allow me to shred from the command prompt if its a folder. how can i shred a folder form the command prompt.
[aday@schrock321 AD]$ shred -v -f -u -z '/home/AD/Desktop/Trash/joe2'
shred: /home/AD/Desktop/Trash/joe2: Is a directory
[aday@schrock321 AD]$
jailbait
Shredding overwrites a file's contents and then deletes the file. Since a folder has no contents then shredding a folder is meaningless. Just delete the folder.
illtbagu
ahhhh missunderstood. i have a folder with files in it. i dont care about the folder. i dont want to cd into every sub folder just so i can shred every thing in its contents. yes i know i could just use the shred from my file manager (which by the way shreds the entire contents of the folder) but i would like to do this from the console. thats what linux is about right power from both the command line and GUI. but the GUI in this case is allowing me to shred a folders entire contents while the console is not letting me.
looking back at my post i said this completely wrong.
jailbait
I tried several experiments and you are right about the way shred works. It seems to insist on working on only one file per command. I did come up with the following command. Some variation of the following command will probably do what you want:
find /home/AD/Desktop/Trash/joe2 -iname "*" -exec shred {} -v -f -u -z \;
illtbagu
hey jailbait thanks that worked great. i have got to do some studying on scripting. i just thought it too be kind of silly that shred didnt have the option though.
gzip allows you to do this
-r --recursive operate recursively on directories
i was also supprised that i coulnt find where someone had asked this question before.
sir woofy
I just added ;rm -rf /home/AD/Desktop/Trash/joe2/ to the end of it to del all folders so
find /home/AD/Desktop/Trash/joe2 -iname "*" -exec shred {} -v -f -u -z \;;rm -rf /home/AD/Desktop/Trash/joe2/
but am I right in saying that the folder names could still be recoverable?
jailbait
"am I right in saying that the folder names could still be recoverable?"
Yes, you might use the mv command to rename the directories to something meaningless before you delete the directories.
No comments:
Post a Comment