Created
September 30, 2017 13:38
-
-
Save 0guzhan/9a6d2f7da1c1842e42341388c2eb4fee to your computer and use it in GitHub Desktop.
Bash File Testing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bash File Testing | |
-b filename - Block special file | |
-c filename - Special character file | |
-d directoryname - Check for directory Existence | |
-e filename - Check for file existence, regardless of type (node, directory, socket, etc.) | |
-f filename - Check for regular file existence not a directory | |
-G filename - Check if file exists and is owned by effective group ID | |
-G filename set-group-id - True if file exists and is set-group-id | |
-k filename - Sticky bit | |
-L filename - Symbolic link | |
-O filename - True if file exists and is owned by the effective user id | |
-r filename - Check if file is a readable | |
-S filename - Check if file is socket | |
-s filename - Check if file is nonzero size | |
-u filename - Check if file set-user-id bit is set | |
-w filename - Check if file is writable | |
-x filename - Check if file is executable |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment