Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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]$
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.
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.
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:
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.
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?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.