TheDocumentation Index
Fetch the complete documentation index at: https://docs.syntblaze.com/llms.txt
Use this file to discover all available pages before exploring further.
-ef (equivalent file) operator is a binary file test operator in Bash that evaluates whether two paths refer to the identical physical file on the filesystem.
It returns a true (0) exit status if and only if both files exist and possess the exact same device number (st_dev) and inode number (st_ino).
Technical Behavior
- System-Level Evaluation: The operator relies on the underlying
stat()system call. It does not perform byte-by-byte content comparison or string-based path comparison. It strictly compares the filesystem metadata (st_devandst_inofields). - Symbolic Link Dereferencing: The
-efoperator automatically resolves (dereferences) symbolic links. IfFILE1is a symlink pointing toFILE2, the operator evaluates the inode of the resolved target, resulting in a true evaluation. - Hard Link Resolution: Because hard links are multiple directory entries pointing to the same inode on the same filesystem, comparing two distinct hard link paths of the same file with
-efwill evaluate to true. - Non-Existent Files: If either
FILE1orFILE2does not exist, or if either path resolves to a broken symbolic link, the operator evaluates to false (1) without throwing a syntax error.
Master Bash with Deep Grasping Methodology!Learn More





