3 replaced http://unix.stackexchange.com/ with https://unix.stackexchange.com/
source | link
find -type f \( -name "*zip" -o -name "*tar" -o -name "*gz" \) -size +1M -delete
  • the \( \) construct allows to group different filename patterns
  • by using -delete option, we can avoid piping and troubles with xargs See thisthis, this and thisthis
  • ./ or . is optional when using find command for current directory


Edit: As Eric Renouf notes, if your version of find doesn't support the -delete option, use the -exec option

find -type f \( -name "*zip" -o -name "*tar" -o -name "*gz" \) -size +1M -exec rm {} +

where all the files filtered by find command is passed to rm command

find -type f \( -name "*zip" -o -name "*tar" -o -name "*gz" \) -size +1M -delete
  • the \( \) construct allows to group different filename patterns
  • by using -delete option, we can avoid piping and troubles with xargs See this, this and this
  • ./ or . is optional when using find command for current directory


Edit: As Eric Renouf notes, if your version of find doesn't support the -delete option, use the -exec option

find -type f \( -name "*zip" -o -name "*tar" -o -name "*gz" \) -size +1M -exec rm {} +

where all the files filtered by find command is passed to rm command

find -type f \( -name "*zip" -o -name "*tar" -o -name "*gz" \) -size +1M -delete
  • the \( \) construct allows to group different filename patterns
  • by using -delete option, we can avoid piping and troubles with xargs See this, this and this
  • ./ or . is optional when using find command for current directory


Edit: As Eric Renouf notes, if your version of find doesn't support the -delete option, use the -exec option

find -type f \( -name "*zip" -o -name "*tar" -o -name "*gz" \) -size +1M -exec rm {} +

where all the files filtered by find command is passed to rm command

2 added solution using -exec option as per Eric Renouf's suggestion in comments
source | link
find -type f \( -name "*zip" -o -name "*tar" -o -name "*gz" \) -size +1M -delete
  • the \( \) construct allows to group different filename patterns
  • by using -delete option, we can avoid piping and troubles with xargs See this, this and this
  • ./ or . is optional when using find command for current directory


Edit: As Eric Renouf notes, if your version of find doesn't support the -delete option, use the -exec option

find -type f \( -name "*zip" -o -name "*tar" -o -name "*gz" \) -size +1M -exec rm {} +

where all the files filtered by find command is passed to rm command

find -type f \( -name "*zip" -o -name "*tar" -o -name "*gz" \) -size +1M -delete
  • the \( \) construct allows to group different filename patterns
  • by using -delete option, we can avoid piping and troubles with xargs See this, this and this
  • ./ or . is optional when using find command for current directory
find -type f \( -name "*zip" -o -name "*tar" -o -name "*gz" \) -size +1M -delete
  • the \( \) construct allows to group different filename patterns
  • by using -delete option, we can avoid piping and troubles with xargs See this, this and this
  • ./ or . is optional when using find command for current directory


Edit: As Eric Renouf notes, if your version of find doesn't support the -delete option, use the -exec option

find -type f \( -name "*zip" -o -name "*tar" -o -name "*gz" \) -size +1M -exec rm {} +

where all the files filtered by find command is passed to rm command

1
source | link

find -type f \( -name "*zip" -o -name "*tar" -o -name "*gz" \) -size +1M -delete
  • the \( \) construct allows to group different filename patterns
  • by using -delete option, we can avoid piping and troubles with xargs See this, this and this
  • ./ or . is optional when using find command for current directory