Help using shred instead of rm


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Help using shred instead of rm
# 8  
Old 07-17-2006
Quote:
Originally Posted by jack1981
Hi, thanks again.

I still get the error however, even with a space, my code is like so:

find $TRASH/$1 -type f -exec shred -fu '{}' \ 2>/dev/null

any ideas why?
here you forget ;

try simple example below first, this will print all files from home directory

Code:
$ find ~ -type f -exec ls {} \; 2>/dev/null

# 9  
Old 07-17-2006
By the way you cannot shred directories,
why you do not use simple rm -rf $TRASH/$1 instead of shred/rm?
# 10  
Old 07-17-2006
Well its for course work and I will be aliasing my script to "rm" so I would be calling my script, I could use /bin/rm but thats not allowed.

BTW I tried that command with space and still -exec error about arguments.

Any ideas?

I added the ;

Thanlks for your troubles

Jack
# 11  
Old 07-17-2006
Quote:
Originally Posted by jack1981
Well its for course work and I will be aliasing my script to "rm" so I would be calling my script, I could use /bin/rm but thats not allowed.

BTW I tried that command with space and still -exec error about arguments.

Any ideas?

I added the ;

Thanlks for your troubles

Jack
Well we don't allow homework/coursework here, but since you have made the main effort I'll bend the rule. You can do it the way you originally intended. You need to combine it with a find command similar to the one above, but you will need it to work on directories you will also encounter one more problem doing this but you should be able to figure it out by reading the man pages for find.
# 12  
Old 07-18-2006
Quote:
Originally Posted by reborg
Well we don't allow homework/coursework here, but since you have made the main effort I'll bend the rule. You can do it the way you originally intended. You need to combine it with a find command similar to the one above, but you will need it to work on directories you will also encounter one more problem doing this but you should be able to figure it out by reading the man pages for find.
Thanks,

I am runnign the find command in the above script to shred and I still get missing argument to -exec as an error message, I have it printed exactly as above with the ";" added and space at the end.

Any ideas why it won't work in my script, BTW it works from the command line becase I ran it without a file argument and it deletd all my files!!

Ta

Jack
# 13  
Old 07-18-2006
try to surround path with quotes

find "$TRASH/$1" -type f -exec shred -fu '{}'; \ 2>/dev/null

I this wouldn't work I haven't any idea where the problem is
# 14  
Old 07-18-2006
look very closely at what is already quoted.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

5 More Discussions You Might Find Interesting

1. BSD

Wipe out userland caches with shred, bleach bit is out of reach

Another topic that bothers me on bsd is the missing of bleach-bit. Looking at what bleach-bit can clean, the new version, it wipes out all the caches of the user. May someone can give me a hint how to clean the userland in bsd and all the hidden caches for the user. shred all rubbish or LSA cookies... (0 Replies)
Discussion started by: 1in10
0 Replies

2. UNIX for Advanced & Expert Users

shred() not working on ext* file systems

When vfat format my128kb flash drive, shred works fine. But, when I format it using ext2 or ext3, shred() exits with this error: shred: /dev/sdb1: pass 1/1 (random)... shred: /dev/sdb1: error writing at offset 12288: Invalid argumentAnyone know what is going on? (0 Replies)
Discussion started by: codecellar
0 Replies

3. UNIX for Advanced & Expert Users

shred multiple options

I've created a wxpython gui for the shred command. I can successfully mix and match all the shred options except two: -size and --random-source. (Man page definitions below). -size and --random-source seem to only work when they are used as the sole option passed. For example, I can zero a... (0 Replies)
Discussion started by: codecellar
0 Replies

4. UNIX for Dummies Questions & Answers

Shred utility

Hi experts. We have a HP-Unix server, we deleted some files and folders from the server. Is there any utilities that we can use to ensure those deleted files and folders are not recoverable? We used rm command to delete these files. Cheers, RT:confused: (1 Reply)
Discussion started by: robtseng
1 Replies

5. Shell Programming and Scripting

BASH : Find files by date and shred them

Good afternoon everyone, For security reasons, I need to delete files on a HDD I have to send after the ending of a demo. I need to find all the files which not end by ".log" and which have been created for 45 days. After getting the file list, I would like to use the shred command. It... (2 Replies)
Discussion started by: cbismuth
2 Replies
Login or Register to Ask a Question