View previous topic :: View next topic |
Author |
Message |
glurps Apprentice
Joined: 11 Mar 2004 Posts: 292
|
Posted: Fri Sep 03, 2004 1:33 pm Post subject: find -exec <?> |
|
|
Code: | /usr/mp3 jrb$ find /usr/mp3/test/ -type f -name '.*' -exec rm {}\;
find: missing argument to `-exec'
/usr/mp3 jrb$ find /usr/mp3/test/ -type f -name '.*' -exec rm \{\}\;
find: missing argument to `-exec' |
what am i doing wrong? |
|
Back to top |
|
|
hjnenc Veteran
Joined: 15 Aug 2004 Posts: 1599 Location: Vienna, Austria
|
Posted: Fri Sep 03, 2004 1:41 pm Post subject: |
|
|
leave a space between } and \; |
|
Back to top |
|
|
glurps Apprentice
Joined: 11 Mar 2004 Posts: 292
|
Posted: Fri Sep 03, 2004 2:18 pm Post subject: |
|
|
thx |
|
Back to top |
|
|
oberyno Guru
Joined: 15 Feb 2004 Posts: 467 Location: /bin/zsh
|
Posted: Fri Sep 03, 2004 3:27 pm Post subject: |
|
|
In zsh you could just do this: Code: | rm /usr/mp3/test/*(.) |
The (.) is a glob qualifier for regular files. |
|
Back to top |
|
|
glurps Apprentice
Joined: 11 Mar 2004 Posts: 292
|
Posted: Sun Sep 05, 2004 12:00 pm Post subject: |
|
|
i don't think this would remove files from any subfolders, then again i only know bash. |
|
Back to top |
|
|
oberyno Guru
Joined: 15 Feb 2004 Posts: 467 Location: /bin/zsh
|
Posted: Sun Sep 05, 2004 1:20 pm Post subject: |
|
|
Right, it would only remove things in the current directory. In zsh you can use ** to search recursively. Code: | rm /usr/mp3/test/**/*(.) | Use *** to search across symlinks.
Edit: Add a . before the last * to remove all files that start with a dot as per your example. |
|
Back to top |
|
|
|