The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > Linux
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #9 (permalink)  
Old 04-13-2008
ghostdog74 ghostdog74 is offline
Registered User
 

Join Date: Sep 2006
Posts: 1,448
yes sometimes we just miss the simplest things. however take note it still suffers from "argument too long" issues if there are too many directories ( maybe there's a workaround somewhere)
Code:
# ls -p | grep "/" | wc -l
31998
# rm -r */
bash: /bin/rm: Argument list too long
# ls -p|awk '/\/$/&&!/\./' | xargs -i rm -rf "{}"
# ls -p | grep "/" | wc -l
0
Reply With Quote