[(1)

πŸ“¦
version 0.7.0 Β· 3 versions
, in epel 10, fedora 43, fedora 44

πŸ’– NAME πŸ’–

[ β€” the little bracket that checks file types and compares values. That's the whole job, bestie. No cap.


✨ SYNOPSIS ✨

[ [-h|--help] [-V|--version]

🌸 DESCRIPTION 🌸

Okay so, [ checks file types and compares values. She's giving very much the same energy as test, just wearing a bracket costume and standing at the door of your shell script like a bouncer. 🫢


πŸŽ€ OPTIONS πŸŽ€

  • -h, --help β€” prints the help. iconic behavior, honestly. ✨
  • -V, --version β€” prints the version. πŸ’…

πŸ”₯ EXTRA πŸ”₯

She exits with the status determined by EXPRESSION. That's the vibe check β€” exit status is the answer.

An omitted EXPRESSION defaults to false. Otherwise, EXPRESSION is true or false and sets the 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

πŸ¦‹ String operations πŸ¦‹

  • -n STRING β€” the length of STRING is nonzero
  • STRING β€” equivalent to -n STRING
  • -z STRING β€” the length of STRING is zero
  • STRING1 = STRING2 β€” the strings are equal
  • STRING1 != STRING2 β€” the strings are not equal
  • STRING1 > STRING2 β€” STRING1 is greater than STRING2 in the current locale
  • STRING1 < STRING2 β€” STRING1 is less than STRING2 in the current locale

🌈 Integer comparisons 🌈

  • 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

πŸ’œ File operations πŸ’œ

  • 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
  • -b FILE β€” FILE exists and is block special
  • -c FILE β€” FILE exists and is character special
  • -d FILE β€” FILE exists and is a directory
  • -e FILE β€” FILE exists
  • -f FILE β€” FILE exists and is a regular file
  • -g FILE β€” FILE exists and is set-group-ID
  • -G FILE β€” FILE exists and is owned by the effective group ID
  • -h FILE β€” FILE exists and is a symbolic link (same as -L)
  • -k FILE β€” FILE exists and has its sticky bit set
  • -L FILE β€” FILE exists and is a symbolic link (same as -h)
  • -N FILE β€” FILE exists and has been modified since it was last read
  • -O FILE β€” FILE exists and is owned by the effective user ID
  • -p FILE β€” FILE exists and is a named pipe
  • -r FILE β€” FILE exists and read permission is granted
  • -s FILE β€” FILE exists and has a size greater than zero
  • -S FILE β€” FILE exists and is a socket
  • -t FD β€” file descriptor FD is opened on a terminal
  • -u FILE β€” FILE exists and its set-user-ID bit is set
  • -w FILE β€” FILE exists and write permission is granted
  • -x FILE β€” FILE exists and execute (or search) permission is granted

Except for -h and -L, all FILE-related tests dereference (follow) symbolic links. Beware that parentheses 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. fr fr, don't do the ambiguous thing.
NOTE: [ honors the --help and --version options, but test does not. test treats each of those as it treats any other nonempty STRING. not me getting caught out by that πŸ’€
NOTE: your shell may have its own version of test and/or [, which usually supersedes the version described here. Please refer to your shell's documentation for details about the options it supports. she's got her own rules, iykyk.

⭐ VERSION ⭐

v(uutils coreutils) 0.7.0


And that's the whole page, bestie β€” this was [ (uutils coreutils) 0.7.0, the General Commands Manual edition of [(1). Go forth and bracket responsibly. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from
  • epel 10: rust-coreutils-devel 0.7.0-10.el10_3 Β· MIT
  • epel 10: uutils-coreutils 0.7.0-10.el10_3 Β· (MIT OR Apache-2.0) AND Unicode-DFS-2016 AND Zlib AND (0BSD OR MIT OR Apache-2.0) AND Apache-2.0 AND (Apache-2.0 OR Apache-2.0 WITH LLVM-exception) AND (Apache-2.0 OR GPL-2.0-only) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND BSD-2-Clause AND (BSD-2-Clause OR Apache-2.0 OR MIT) AND BSD-3-Clause AND CC0-1.0 AND ISC AND MIT AND (MIT OR Zlib OR Apache-2.0) AND (MIT-0 OR Apache-2.0) AND Unicode-3.0 AND (Unlicense OR MIT)
  • fedora 43: rust-coreutils-devel 0.7.0-12.fc43 Β· MIT
  • fedora 43: uutils-coreutils 0.7.0-12.fc43 Β· (MIT OR Apache-2.0) AND Unicode-DFS-2016 AND Zlib AND (0BSD OR MIT OR Apache-2.0) AND Apache-2.0 AND (Apache-2.0 OR Apache-2.0 WITH LLVM-exception) AND (Apache-2.0 OR GPL-2.0-only) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND BSD-2-Clause AND (BSD-2-Clause OR Apache-2.0 OR MIT) AND BSD-3-Clause AND CC0-1.0 AND ISC AND MIT AND (MIT OR Zlib OR Apache-2.0) AND (MIT-0 OR Apache-2.0) AND Unicode-3.0 AND (Unlicense OR MIT)
  • fedora 44: rust-coreutils-devel 0.7.0-4.fc44 Β· MIT
  • fedora 44: uutils-coreutils 0.7.0-4.fc44 Β· (MIT OR Apache-2.0) AND Unicode-DFS-2016 AND Zlib AND (0BSD OR MIT OR Apache-2.0) AND Apache-2.0 AND (Apache-2.0 OR Apache-2.0 WITH LLVM-exception) AND (Apache-2.0 OR GPL-2.0-only) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND BSD-2-Clause AND (BSD-2-Clause OR Apache-2.0 OR MIT) AND BSD-3-Clause AND CC0-1.0 AND ISC AND MIT AND (MIT OR Zlib OR Apache-2.0) AND (MIT-0 OR Apache-2.0) AND Unicode-3.0 AND (Unlicense OR MIT)
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms