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)
file1 -nt file2
file1 is newer than file2
file1 -ot file2
file1 is older than file2
-b file
file exist and is a block-special (device) file
-c
file exist and is a character-special (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 his its “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)