{
    "content": [
        {
            "type": "text",
            "text": "# test(1) (man)\n\n**Summary:** test - check file types and compare values\n\n**Synopsis:** test EXPRESSION\n\n## Flags\n\n| Flag | Long | Arg | Description |\n|------|------|-----|-------------|\n| — | --version | — | output version information and exit An omitted EXPRESSION defaults to false. Otherwise, EXPRESSION is true or false and  |\n| -n | — | — | the length of STRING is nonzero STRING equivalent to -n STRING |\n| -z | — | — | the length of STRING is zero STRING1 = STRING2 the strings are equal STRING1 != STRING2 the strings are not equal INTEGE |\n| -b | — | — | FILE exists and is block special |\n| -c | — | — | FILE exists and is character special |\n| -d | — | — | FILE exists and is a directory |\n| -e | — | — | FILE exists |\n| -f | — | — | FILE exists and is a regular file |\n| -g | — | — | FILE exists and is set-group-ID |\n| -G | — | — | FILE exists and is owned by the effective group ID |\n| -h | — | — | FILE exists and is a symbolic link (same as -L) |\n| -k | — | — | FILE exists and has its sticky bit set |\n| -L | — | — | FILE exists and is a symbolic link (same as -h) |\n| -N | — | — | FILE exists and has been modified since it was last read |\n| -O | — | — | FILE exists and is owned by the effective user ID |\n| -p | — | — | FILE exists and is a named pipe |\n| -r | — | — | FILE exists and read permission is granted |\n| -s | — | — | FILE exists and has a size greater than zero |\n| -S | — | — | FILE exists and is a socket |\n| -t | — | — |  |\n| -u | — | — | FILE exists and its set-user-ID bit is set |\n| -w | — | — | FILE exists and write permission is granted |\n| -x | — | — | FILE exists and execute (or search) permission is granted Except for -h and -L, all FILE-related tests dereference symbo |\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (1 lines) — 2 subsections\n  - test (1 lines)\n  - [ ] (2 lines)\n- **DESCRIPTION** (4 lines) — 23 subsections\n  - --version (17 lines)\n  - -n (4 lines)\n  - -z (35 lines)\n  - -b (2 lines)\n  - -c (2 lines)\n  - -d (2 lines)\n  - -e (2 lines)\n  - -f (2 lines)\n  - -g (2 lines)\n  - -G (2 lines)\n  - -h (2 lines)\n  - -k (2 lines)\n  - -L (2 lines)\n  - -N (2 lines)\n  - -O (2 lines)\n  - -p (2 lines)\n  - -r (2 lines)\n  - -s (2 lines)\n  - -S (2 lines)\n  - -t (1 lines)\n  - -u (2 lines)\n  - -w (2 lines)\n  - -x (16 lines)\n- **AUTHOR** (2 lines)\n- **REPORTING BUGS** (3 lines)\n- **COPYRIGHT** (5 lines)\n- **SEE ALSO** (6 lines)\n\n## Full Content\n\n### NAME\n\ntest - check file types and compare values\n\n### SYNOPSIS\n\ntest EXPRESSION\n\n#### test\n\n[ EXPRESSION ]\n\n#### [ ]\n\n[ OPTION\n\n### DESCRIPTION\n\nExit with the status determined by EXPRESSION.\n\n--help display this help and exit\n\n#### --version\n\noutput version information and exit\n\nAn  omitted  EXPRESSION  defaults  to false.  Otherwise, EXPRESSION is true or false and sets\nexit status.  It is one of:\n\n( EXPRESSION )\nEXPRESSION is true\n\n! EXPRESSION\nEXPRESSION is false\n\nEXPRESSION1 -a EXPRESSION2\nboth EXPRESSION1 and EXPRESSION2 are true\n\nEXPRESSION1 -o EXPRESSION2\neither EXPRESSION1 or EXPRESSION2 is true\n\n#### -n\n\nthe length of STRING is nonzero\n\nSTRING equivalent to -n STRING\n\n#### -z\n\nthe length of STRING is zero\n\nSTRING1 = STRING2\nthe strings are equal\n\nSTRING1 != STRING2\nthe strings are not equal\n\nINTEGER1 -eq INTEGER2\nINTEGER1 is equal to INTEGER2\n\nINTEGER1 -ge INTEGER2\nINTEGER1 is greater than or equal to INTEGER2\n\nINTEGER1 -gt INTEGER2\nINTEGER1 is greater than INTEGER2\n\nINTEGER1 -le INTEGER2\nINTEGER1 is less than or equal to INTEGER2\n\nINTEGER1 -lt INTEGER2\nINTEGER1 is less than INTEGER2\n\nINTEGER1 -ne INTEGER2\nINTEGER1 is not equal to INTEGER2\n\nFILE1 -ef FILE2\nFILE1 and FILE2 have the same device and inode numbers\n\nFILE1 -nt FILE2\nFILE1 is newer (modification date) than FILE2\n\nFILE1 -ot FILE2\nFILE1 is older than FILE2\n\n#### -b\n\nFILE exists and is block special\n\n#### -c\n\nFILE exists and is character special\n\n#### -d\n\nFILE exists and is a directory\n\n#### -e\n\nFILE exists\n\n#### -f\n\nFILE exists and is a regular file\n\n#### -g\n\nFILE exists and is set-group-ID\n\n#### -G\n\nFILE exists and is owned by the effective group ID\n\n#### -h\n\nFILE exists and is a symbolic link (same as -L)\n\n#### -k\n\nFILE exists and has its sticky bit set\n\n#### -L\n\nFILE exists and is a symbolic link (same as -h)\n\n#### -N\n\nFILE exists and has been modified since it was last read\n\n#### -O\n\nFILE exists and is owned by the effective user ID\n\n#### -p\n\nFILE exists and is a named pipe\n\n#### -r\n\nFILE exists and read permission is granted\n\n#### -s\n\nFILE exists and has a size greater than zero\n\n#### -S\n\nFILE exists and is a socket\n\n#### -t\n\n#### -u\n\nFILE exists and its set-user-ID bit is set\n\n#### -w\n\nFILE exists and write permission is granted\n\n#### -x\n\nFILE exists and execute (or search) permission is granted\n\nExcept for -h and -L, all FILE-related tests dereference symbolic links.  Beware that  paren‐\ntheses  need to be escaped (e.g., by backslashes) for shells.  INTEGER may also be -l STRING,\nwhich evaluates to the length of STRING.\n\nNOTE: Binary -a and -o are inherently ambiguous.  Use 'test EXPR1 &&  test  EXPR2'  or  'test\nEXPR1 || test EXPR2' instead.\n\nNOTE:  [  honors  the  --help  and --version options, but test does not.  test treats each of\nthose as it treats any other nonempty STRING.\n\nNOTE: your shell may have its own version of test and/or [, which usually supersedes the ver‐\nsion  described  here.   Please refer to your shell's documentation for details about the op‐\ntions it supports.\n\n### AUTHOR\n\nWritten by Kevin Braunsdorf and Matthew Bradburn.\n\n### REPORTING BUGS\n\nGNU coreutils online help: <https://www.gnu.org/software/coreutils/>\nReport any translation bugs to <https://translationproject.org/team/>\n\n### COPYRIGHT\n\nCopyright © 2020 Free Software Foundation, Inc.  License GPLv3+: GNU GPL version 3  or  later\n<https://gnu.org/licenses/gpl.html>.\nThis  is free software: you are free to change and redistribute it.  There is NO WARRANTY, to\nthe extent permitted by law.\n\n### SEE ALSO\n\nFull documentation <https://www.gnu.org/software/coreutils/[>\nor available locally via: info '(coreutils) test invocation'\n\n\n\nGNU coreutils 8.32                          January 2026                                     TEST(1)\n\n"
        }
    ],
    "structuredContent": {
        "command": "test",
        "section": "1",
        "mode": "man",
        "summary": "test - check file types and compare values",
        "synopsis": "test EXPRESSION",
        "flags": [
            {
                "flag": "",
                "long": "--version",
                "arg": null,
                "description": "output version information and exit An omitted EXPRESSION defaults to false. Otherwise, EXPRESSION is true or false and sets exit status. It is one of: ( EXPRESSION ) EXPRESSION is true ! EXPRESSION EXPRESSION is false EXPRESSION1 -a EXPRESSION2 both EXPRESSION1 and EXPRESSION2 are true EXPRESSION1 -o EXPRESSION2 either EXPRESSION1 or EXPRESSION2 is true"
            },
            {
                "flag": "-n",
                "long": null,
                "arg": null,
                "description": "the length of STRING is nonzero STRING equivalent to -n STRING"
            },
            {
                "flag": "-z",
                "long": null,
                "arg": null,
                "description": "the length of STRING is zero STRING1 = STRING2 the strings are equal STRING1 != STRING2 the strings are not equal INTEGER1 -eq INTEGER2 INTEGER1 is equal to INTEGER2 INTEGER1 -ge INTEGER2 INTEGER1 is greater than or equal to INTEGER2 INTEGER1 -gt INTEGER2 INTEGER1 is greater than INTEGER2 INTEGER1 -le INTEGER2 INTEGER1 is less than or equal to INTEGER2 INTEGER1 -lt INTEGER2 INTEGER1 is less than INTEGER2 INTEGER1 -ne INTEGER2 INTEGER1 is not equal to INTEGER2 FILE1 -ef FILE2 FILE1 and FILE2 have the same device and inode numbers FILE1 -nt FILE2 FILE1 is newer (modification date) than FILE2 FILE1 -ot FILE2 FILE1 is older than FILE2"
            },
            {
                "flag": "-b",
                "long": null,
                "arg": null,
                "description": "FILE exists and is block special"
            },
            {
                "flag": "-c",
                "long": null,
                "arg": null,
                "description": "FILE exists and is character special"
            },
            {
                "flag": "-d",
                "long": null,
                "arg": null,
                "description": "FILE exists and is a directory"
            },
            {
                "flag": "-e",
                "long": null,
                "arg": null,
                "description": "FILE exists"
            },
            {
                "flag": "-f",
                "long": null,
                "arg": null,
                "description": "FILE exists and is a regular file"
            },
            {
                "flag": "-g",
                "long": null,
                "arg": null,
                "description": "FILE exists and is set-group-ID"
            },
            {
                "flag": "-G",
                "long": null,
                "arg": null,
                "description": "FILE exists and is owned by the effective group ID"
            },
            {
                "flag": "-h",
                "long": null,
                "arg": null,
                "description": "FILE exists and is a symbolic link (same as -L)"
            },
            {
                "flag": "-k",
                "long": null,
                "arg": null,
                "description": "FILE exists and has its sticky bit set"
            },
            {
                "flag": "-L",
                "long": null,
                "arg": null,
                "description": "FILE exists and is a symbolic link (same as -h)"
            },
            {
                "flag": "-N",
                "long": null,
                "arg": null,
                "description": "FILE exists and has been modified since it was last read"
            },
            {
                "flag": "-O",
                "long": null,
                "arg": null,
                "description": "FILE exists and is owned by the effective user ID"
            },
            {
                "flag": "-p",
                "long": null,
                "arg": null,
                "description": "FILE exists and is a named pipe"
            },
            {
                "flag": "-r",
                "long": null,
                "arg": null,
                "description": "FILE exists and read permission is granted"
            },
            {
                "flag": "-s",
                "long": null,
                "arg": null,
                "description": "FILE exists and has a size greater than zero"
            },
            {
                "flag": "-S",
                "long": null,
                "arg": null,
                "description": "FILE exists and is a socket"
            },
            {
                "flag": "-t",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "-u",
                "long": null,
                "arg": null,
                "description": "FILE exists and its set-user-ID bit is set"
            },
            {
                "flag": "-w",
                "long": null,
                "arg": null,
                "description": "FILE exists and write permission is granted"
            },
            {
                "flag": "-x",
                "long": null,
                "arg": null,
                "description": "FILE exists and execute (or search) permission is granted Except for -h and -L, all FILE-related tests dereference symbolic links. Beware that paren‐ theses need to be escaped (e.g., by backslashes) for shells. INTEGER may also be -l STRING, which evaluates to the length of STRING. NOTE: Binary -a and -o are inherently ambiguous. Use 'test EXPR1 && test EXPR2' or 'test EXPR1 || test EXPR2' instead. NOTE: [ honors the --help and --version options, but test does not. test treats each of those as it treats any other nonempty STRING. NOTE: your shell may have its own version of test and/or [, which usually supersedes the ver‐ sion described here. Please refer to your shell's documentation for details about the op‐ tions it supports."
            }
        ],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "test",
                        "lines": 1
                    },
                    {
                        "name": "[ ]",
                        "lines": 2
                    }
                ]
            },
            {
                "name": "DESCRIPTION",
                "lines": 4,
                "subsections": [
                    {
                        "name": "--version",
                        "lines": 17,
                        "long": "--version"
                    },
                    {
                        "name": "-n",
                        "lines": 4,
                        "flag": "-n"
                    },
                    {
                        "name": "-z",
                        "lines": 35,
                        "flag": "-z"
                    },
                    {
                        "name": "-b",
                        "lines": 2,
                        "flag": "-b"
                    },
                    {
                        "name": "-c",
                        "lines": 2,
                        "flag": "-c"
                    },
                    {
                        "name": "-d",
                        "lines": 2,
                        "flag": "-d"
                    },
                    {
                        "name": "-e",
                        "lines": 2,
                        "flag": "-e"
                    },
                    {
                        "name": "-f",
                        "lines": 2,
                        "flag": "-f"
                    },
                    {
                        "name": "-g",
                        "lines": 2,
                        "flag": "-g"
                    },
                    {
                        "name": "-G",
                        "lines": 2,
                        "flag": "-G"
                    },
                    {
                        "name": "-h",
                        "lines": 2,
                        "flag": "-h"
                    },
                    {
                        "name": "-k",
                        "lines": 2,
                        "flag": "-k"
                    },
                    {
                        "name": "-L",
                        "lines": 2,
                        "flag": "-L"
                    },
                    {
                        "name": "-N",
                        "lines": 2,
                        "flag": "-N"
                    },
                    {
                        "name": "-O",
                        "lines": 2,
                        "flag": "-O"
                    },
                    {
                        "name": "-p",
                        "lines": 2,
                        "flag": "-p"
                    },
                    {
                        "name": "-r",
                        "lines": 2,
                        "flag": "-r"
                    },
                    {
                        "name": "-s",
                        "lines": 2,
                        "flag": "-s"
                    },
                    {
                        "name": "-S",
                        "lines": 2,
                        "flag": "-S"
                    },
                    {
                        "name": "-t",
                        "lines": 1,
                        "flag": "-t"
                    },
                    {
                        "name": "-u",
                        "lines": 2,
                        "flag": "-u"
                    },
                    {
                        "name": "-w",
                        "lines": 2,
                        "flag": "-w"
                    },
                    {
                        "name": "-x",
                        "lines": 16,
                        "flag": "-x"
                    }
                ]
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "REPORTING BUGS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 6,
                "subsections": []
            }
        ]
    }
}