LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-03-2003, 07:27 PM   #1
illtbagu
Member
 
Registered: Dec 2002
Location: Nevada
Distribution: fedora, RHEL, ubuntu, suse
Posts: 343

Rep: Reputation: 30
shred folder from konsole


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]$


thanks,
AD
 
Old 05-03-2003, 07:40 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
shredding folders

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.
 
Old 05-03-2003, 08:48 PM   #3
illtbagu
Member
 
Registered: Dec 2002
Location: Nevada
Distribution: fedora, RHEL, ubuntu, suse
Posts: 343

Original Poster
Rep: Reputation: 30
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.

thanks,
AD
 
Old 05-04-2003, 12:48 PM   #4
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
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 \;
 
Old 05-04-2003, 02:59 PM   #5
illtbagu
Member
 
Registered: Dec 2002
Location: Nevada
Distribution: fedora, RHEL, ubuntu, suse
Posts: 343

Original Poster
Rep: Reputation: 30
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.

hey thanks again,
AD
 
Old 05-06-2004, 02:59 AM   #6
sir woofy
LQ Newbie
 
Registered: May 2004
Posts: 4

Rep: Reputation: 0
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?
 
Old 05-06-2004, 09:39 AM   #7
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
"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.

___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeB....home.page.html

Steve Stites
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
why does the new version of kgpg shred so fast? darksmiley Linux - Security 7 04-23-2006 03:02 PM
Deleting Linux, All Partitions, Every Shred of Data! g-force Linux - Newbie 2 05-03-2004 10:04 PM
shred program for ext3 elconde Linux - Software 4 11-24-2003 06:08 PM
Bootdisk with Shred or dd for Alpha bretticus Linux - Newbie 0 11-11-2003 10:22 PM
what is meant by shred? murshed Linux - Newbie 5 04-13-2003 10:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration