Cleaning Ports Tree

Yasuhiro Kimura yasu at
Thu Apr 15 20:58:09 UTC 2021

From: Tim Daneliuk via freebsd-questions <freebsd-questions at>
Subject: Cleaning Ports Tree
Date: Thu, 15 Apr 2021 15:37:08 -0500

> I am aware that one can do this to clean the ports tree:
>   cd /usr/ports
>   make clean
> However, this is very slow.  Is there any reason not to do this instead:
>   find  /usr/ports -type d -name work -exec -vrf {} \;
> This second approach is much, much (much) faster, I just want to make
> sure I am not creating nasty side-effects thereby.

1. If a port is flavorized, default working directory is
   /usr/ports/category/portname/work-(flavor name). and above command
   don't remove it. `make clean` works fine whether or not a port is

2. `make clean` works fine even if WRKDIRPREFIX is set. You need not
   aware where real working directory is.

Yasuhiro Kimura

More information about the freebsd-questions mailing list