# Which files or subdirectories in \`~/.julia/\` can I delete?

**URL:** <https://discourse.julialang.org/t/which-files-or-subdirectories-in-julia-can-i-delete/62230>\
**Category:** General Usage\
**Tags:** question\
**Created:** [June 1, 2021, 9:06pm UTC](https://discourse.julialang.org/t/which-files-or-subdirectories-in-julia-can-i-delete/62230 "2021-06-01T21:06:26Z")\
**Posts on this page:** 2\
**Page:** 2

<div class="post-metadata">

**Author:** ![tbeason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tbeason/32/15898_2.png) [@tbeason](https://discourse.julialang.org/u/tbeason)\
**Post date:** [June 2, 2021, 4:01pm UTC](https://discourse.julialang.org/t/which-files-or-subdirectories-in-julia-can-i-delete/62230/21 "2021-06-02T16:01:03Z")

</div>

[https://github.com/giordano/PkgCleanup.jl/issues/1](https://github.com/giordano/PkgCleanup.jl/issues/1)

---

<div class="post-metadata">

**Author:** ![caleb-allen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/caleb-allen/32/14054_2.png) [@caleb-allen](https://discourse.julialang.org/u/caleb-allen)\
**Post date:** [May 23, 2023, 12:34pm UTC](https://discourse.julialang.org/t/which-files-or-subdirectories-in-julia-can-i-delete/62230/22 "2023-05-23T12:34:24Z")

</div>

Sorry to revive this old thread, but I thought my experience may be useful to others trying to clear up some space in their `.julia` directory, especially those who have used Julia on the same machine over the course of many years and across many Julia versions.

My `.julia`. directory was ~30GB, with the space mostly taken up by the `artifacts` directory. Using `gc` cleared minimal memory.

> [@kristoffer.carlsson](#):
>
> You can pass `--verbose` to `gc` to see the manifests that are being “tracked”.

Using this I discovered that I had many environment manifests for old versions of Julia, going back all the way to `v1.3`.

```julia
[I] caleb@caleb-thinkpad ~/.j/environments> ls -la
total 44K
drwxr-xr-x 2 caleb caleb 4.0K Dec 31 01:50 v1.10/
drwxr-xr-x 2 caleb caleb 4.0K Mar 4 2020 v1.3/
drwxr-xr-x 2 caleb caleb 4.0K Mar 31 2020 v1.4/
drwxr-xr-x 2 caleb caleb 4.0K Aug 19 2020 v1.5/
drwxr-xr-x 2 caleb caleb 4.0K Nov 14 2020 v1.6/
drwxr-xr-x 2 caleb caleb 4.0K May 12 2021 v1.7/
drwxr-xr-x 2 caleb caleb 4.0K Aug 30 2021 v1.8/
drwxr-xr-x 2 caleb caleb 4.0K Jan 12 19:59 v1.9/

```

I cleared out the environments I no longer use

```julia
[I] caleb@caleb-thinkpad ~/.j/environments> rm -rf v1.3 v1.4 v1.5 v1.6 v1.8

```

And the subsequent `gc` removed ~15GB of unused artifacts:

```julia
(@v1.9) pkg> gc --verbose --all
     ...
     Deleted 349 package installations (448.348 MiB)
     Deleted 2 repos (116.330 KiB)
     Deleted 107 artifact installations (14.496 GiB)
     Deleted 2 scratchspaces (10.392 KiB)

```

[Previous page](https://discourse.julialang.org/t/which-files-or-subdirectories-in-julia-can-i-delete/62230.md?page=1)
