{
    "content": [
        {
            "type": "text",
            "text": "# aa-remove-unknown(8) (man)\n\n## TLDR\n\n> Remove AppArmor profiles that are no longer present in the configuration directory.\n\n- Perform a dry run to see which profiles would be removed:\n  `sudo aa-remove-unknown -n`\n- Actually remove the profiles:\n  `sudo aa-remove-unknown`\n- Display help:\n  `aa-remove-unknown {{-h|--help}}`\n\n*Source: tldr-pages*\n\n---\n\n**Summary:** aa-remove-unknown - remove unknown AppArmor profiles\n\n**Synopsis:** aa-remove-unknown [option]\n\n## Flags\n\n| Flag | Long | Arg | Description |\n|------|------|-----|-------------|\n| -h | --help | — | displays a short usage statement. -n dry run; only prints the names of profiles that would be removed |\n\n## Examples\n\n- `$ sudo ./aa-remove-unknown -n`\n- `Would remove 'test//null-/usr/bin/whoami'`\n- `Would remove 'test'`\n- `$ sudo ./aa-remove-unknown`\n- `Removing 'test//null-/usr/bin/whoami'`\n- `Removing 'test'`\n\n## See Also\n\n- apparmor(7)\n- AA-REMOVE-UNKNOWN(8)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (2 lines)\n- **DESCRIPTION** (5 lines)\n- **OPTIONS** (1 lines) — 1 subsections\n  - -h, --help (4 lines)\n- **EXAMPLES** (8 lines)\n- **BUGS** (3 lines)\n- **SEE ALSO** (5 lines)\n\n## Full Content\n\n### NAME\n\naa-remove-unknown - remove unknown AppArmor profiles\n\n### SYNOPSIS\n\naa-remove-unknown [option]\n\n### DESCRIPTION\n\naa-remove-unknown will inventory all profiles in /etc/apparmor.d/, compare that list to the\nprofiles currently loaded into the kernel, and then remove all of the loaded profiles that\nwere not found in /etc/apparmor.d/. It will also report the name of each profile that it\nremoves on standard out.\n\n### OPTIONS\n\n#### -h, --help\n\ndisplays a short usage statement.\n\n-n  dry run; only prints the names of profiles that would be removed\n\n### EXAMPLES\n\n$ sudo ./aa-remove-unknown -n\nWould remove 'test//null-/usr/bin/whoami'\nWould remove 'test'\n\n$ sudo ./aa-remove-unknown\nRemoving 'test//null-/usr/bin/whoami'\nRemoving 'test'\n\n### BUGS\n\nNone. Please report any you find to Gitlab at\n<https://gitlab.com/apparmor/apparmor/-/issues>.\n\n### SEE ALSO\n\napparmor(7)\n\n\n\nAppArmor 3.0.4                               2025-08-15                         AA-REMOVE-UNKNOWN(8)\n\n"
        }
    ],
    "structuredContent": {
        "command": "aa-remove-unknown",
        "section": "8",
        "mode": "man",
        "summary": "aa-remove-unknown - remove unknown AppArmor profiles",
        "synopsis": "aa-remove-unknown [option]",
        "tldr_summary": "Remove AppArmor profiles that are no longer present in the configuration directory.",
        "tldr_examples": [
            {
                "description": "Perform a dry run to see which profiles would be removed",
                "command": "sudo aa-remove-unknown -n"
            },
            {
                "description": "Actually remove the profiles",
                "command": "sudo aa-remove-unknown"
            },
            {
                "description": "Display help",
                "command": "aa-remove-unknown {{-h|--help}}"
            }
        ],
        "tldr_source": "official",
        "flags": [
            {
                "flag": "-h",
                "long": "--help",
                "arg": null,
                "description": "displays a short usage statement. -n dry run; only prints the names of profiles that would be removed"
            }
        ],
        "examples": [
            "$ sudo ./aa-remove-unknown -n",
            "Would remove 'test//null-/usr/bin/whoami'",
            "Would remove 'test'",
            "$ sudo ./aa-remove-unknown",
            "Removing 'test//null-/usr/bin/whoami'",
            "Removing 'test'"
        ],
        "see_also": [
            {
                "name": "apparmor",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/apparmor/7/json"
            },
            {
                "name": "AA-REMOVE-UNKNOWN",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/AA-REMOVE-UNKNOWN/8/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "-h, --help",
                        "lines": 4,
                        "flag": "-h",
                        "long": "--help"
                    }
                ]
            },
            {
                "name": "EXAMPLES",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 5,
                "subsections": []
            }
        ]
    }
}