Find the answer to your Linux question:
Page 2 of 2 FirstFirst 1 2
Results 11 to 12 of 12
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #11

    -execdir option

    From the man page for find:
    -execdir command {} +
    Like -exec, but the specified command is run from the subdirec-
    tory containing the matched file, which is not normally the
    directory in which you started find. This a much more secure
    method for invoking commands, as it avoids race conditions dur-
    ing resolution of the paths to the matched files.
    A more complete discussion of the security considerations around -exec can be found in the info file for findutils - File:, Node: Race Conditions with -exec.
    The security considerations here relate to race conditions, and file systems changing as they are being processed by find. In a single user system, where none of the files are being accessed simultaneously by other users, you are at a lower risk of exposure to these race conditions. In such cases, -exec 'should' be safe for your purposes.

  2. #12

    recursive shred

    Here's a quick perl script that can do recursive shred,
    name the file

    "copy code"
    open a terminal
    "shift insert" paste
    "chmod 700"

    run it in the super directory of the directory you wish to shred, or give the full path to the directory you wish to shred.

    ./ [directory name] [number of times you wish to write over the files]

    @lines = `ls -Rt1A $ARGV[0]`;
    $size = scalar(@files);
    $i = 0;
    $line = "";
    @cut = "";
    @cut2 = "";
    @cut3 = "";
    $size3 = 0;
    $size4 = 0;
    $directory = "";
    foreach $line (@lines)
     if($line =~ m/\//)
       @cut = split(':', $line);
       $cut[0] =~ s/ /*/g;
       $directory = $cut[0];
     elsif($line ne "" || $line ne " " || $line ne "\n")
     $line =~ s/ /*/g;
     system("shred -fvuz -n $ARGV[1] $directory/$line");
     system("rm -fr $ARGV[0]");

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts