LPIC-1 Exam 102 v5 (Linux Administrator) — Question 120
Which of the following comparison operators for test work on elements in the file system? (Choose two.)
Answer options
- A. -z
- B. -eq
- C. -d
- D. -f
- E. -lt
Correct answer: C, D
Explanation
The correct answers are C (-d) and D (-f) because they specifically test for the existence and type of files or directories in the file system. Option A (-z) checks for empty strings, B (-eq) is for numeric equality, and E (-lt) is for numeric comparison, none of which pertain to file system elements.