View previous topic :: View next topic |
Author |
Message |
EnlightedGnome Tux's lil' helper
Joined: 07 Jun 2005 Posts: 126 Location: Denmark, Odense
|
Posted: Sat Aug 27, 2005 4:49 pm Post subject: Recursively delete executable files [solved] |
|
|
How can I recursively delete all executable files in a given folder? _________________ checking for -lifesign in -Kenny... no
- oh my god, they killed Kenny
Last edited by EnlightedGnome on Sat Aug 27, 2005 8:00 pm; edited 1 time in total |
|
Back to top |
|
|
marvin5 Apprentice
Joined: 19 Mar 2005 Posts: 162 Location: Germany
|
Posted: Sat Aug 27, 2005 4:55 pm Post subject: |
|
|
Use find -perm (check man find for details)
-- marvin |
|
Back to top |
|
|
frenkel Veteran
Joined: 13 May 2003 Posts: 1034 Location: .nl
|
Posted: Sat Aug 27, 2005 4:58 pm Post subject: |
|
|
$ man find
<snip>
Code: |
-perm mode
File's permission bits are exactly mode (octal or symbolic).
Symbolic modes use mode 0 as a point of departure.
-perm -mode
All of the permission bits mode are set for the file.
-perm +mode
Any of the permission bits mode are set for the file.
|
<snip>
Code: |
-exec command ;
Execute command; true if 0 status is returned. All following
arguments to find are taken to be arguments to the command until
an argument consisting of `;' is encountered. The string `{}'
is replaced by the current file name being processed everywhere
it occurs in the arguments to the command, not just in arguments
where it is alone, as in some versions of find. Both of these
constructions might need to be escaped (with a `\') or quoted to
protect them from expansion by the shell. The command is exe-
cuted in the starting directory.
|
|
|
Back to top |
|
|
EnlightedGnome Tux's lil' helper
Joined: 07 Jun 2005 Posts: 126 Location: Denmark, Odense
|
Posted: Sat Aug 27, 2005 6:28 pm Post subject: |
|
|
so something like
find path -perm +0001 -exec rm {} \;
will work? _________________ checking for -lifesign in -Kenny... no
- oh my god, they killed Kenny |
|
Back to top |
|
|
frenkel Veteran
Joined: 13 May 2003 Posts: 1034 Location: .nl
|
Posted: Sat Aug 27, 2005 8:39 pm Post subject: |
|
|
Test it in a directory with some test data. |
|
Back to top |
|
|
|