File Expressions Flashcards
file1 -ef file2
file1 and file2 have the same inode numbers
(the two filenames refer to the same file by hard linking)
Effectively the same File
file1 -nt file2
file1 is newer than file2
file1 -ot file2
file1 is older than file2
-b file
file exist and is a
Special-Block
(device) file
-c
file exist and is a
Special-Character
(device) file
-d file
file exist and is a directory
-e file
file exist
-f file
file exist and a regular file
-g file
file exist and is a set-group-id
-G file
file exist and is owned by the effective group ID
-k file
file exist and has it’s
“Sticky Bit”
set
-L file
file exists and is a symbolic link
-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 is readable (has read permissions for effective user)
-s file
file exist and has a
SIZE
greater than 0
-S file
file exists and is a
network Socket
-t fd
fd is a
File Descriptor
directed to/from the
Terminal.
Used to determine whether standard input/output/error is being redirected
-u file
file exists and is a
setuid
(Set U ID)
-w file
file exists and is writable (has write permissions for the effective user)
-x file
file exists and is executable