English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I want to delete only *.pdf files in multiple nested categories.

How can I do that?

2007-03-26 10:56:37 · 2 answers · asked by chikko_mon 2 in Computers & Internet Programming & Design

2 answers

one way is by using the find command with the -exec or -delete options.

read the find man page for details, but as an example to list pdfs in the /tmp/foo/ directory recursively, you would do:

find /tmp/foo/. -type f -name "*.pdf" -exec echo {} ';'

to delete them, simply change "echo" to "rm"

2007-03-26 11:09:51 · answer #1 · answered by javier 2 · 0 0

Use the "find" command eith the exec option
find . -name "*.pdf" -exec rm {}\;

Do a "man find" to check the syntax before you do.

2007-03-26 11:10:29 · answer #2 · answered by Niklaus Pfirsig 6 · 0 0

fedest.com, questions and answers