Alt Text

A screenshot of a file manager preview window for my ~/.cache folder, which takes up 164.3 GiB and has 246,049 files and 15,126 folders. The folder was first created about 1.75 years ago with my system

  • glibg10b@lemmy.ml
    link
    fedilink
    arrow-up
    3
    ·
    edit-2
    1 年前

    Neat, thanks for sharing

    Here’s the above pseudocode in bash:

    find /home/ -mindepth 1 -maxdepth 1 -type d -exec mount none {}/.cache/ -t tmpfs -o size=16G \;
    

    for doesn’t work here because it uses spaces to delimit strings, which could cause issues with filenames that contain spaces

    You can also create a systemd user service, which is useful if you don’t have root access. The above mount command requires root, but the following doesn’t and is more robust than symlinking to /tmp/:

    ln -s $(mktemp -dp /var/tmp/) ~/.config/