-e Whether the “Document” exists (commonly used)
-f whether the “Document” exists and is a file (commonly used)
-d whether this “document” exists and is a directory (commonly used)
-b Whether the Document exists and is a Block Device
-c Whether this Document exists and is a Character Device
-s whether this “document” exists and is a Socket file
-p Whether the “Document” exists and is a FIFO (PIPE) file
-l Whether the Document exists and is a link file
p>
-r checks if the document exists and has “readable” permissions
-w checks if the document exists and has the permission to be writable
-x checks if the document exists and has “executable” permissions
-u checks if the document name exists and has the property “SUID”
-g checks if the document name exists and has the attribute “SGID”
-k checks if the document name exists and has a “Sticky bit” property
-s checks if the document exists and is a “non-blank file”
>
>
>
>
>
>
>
>
-nt (newer than) determines whether file1 is newer than file2
-ot (older than) determines whether file1 is older than file2
-ef determines whether file1 and file2 are the same file, which can be used to determine the hard link. The key is to determine if both files point to the same inode
4. About the comparison between two integers, for example test n1 -eq n2
-Eq equals two values.
-Ne is not equal.
-gt n1 is greater than n2 (greater than)
-lt n1 is less than n2 (less than)
-e e n1 is greater than or equal to n2 (greater than or equal)
-le n1 is less than or equal to n2.
5
The test-z string determines if the string is empty and returns true for empty
Test-n string determines that the string is not null and returns false for null
= test -r filename -a-x filename
= test -r filename -a-x filename
– A (and) is both true! Test-r file-a-x file = test-r file-a-x file = test-r file-a-x file = test-r file-a-x file = test-r file-a-x file = test-r file-a-x file = test-r file-a-x file
-O (OR) Either is true! Test-r file-o-x file = test-r file-o-x file = test-r file-o-x file = test-r file-o-x file = test-r file-o-x file = test-r file-o-x file = test-r file-o-x file
! Inverse state, such as test! -x file. Returns true if file does not have x
Read More:
- Principle and usage of feof ()
- Java compareto() method
- Differences between shell script variable assignment and C language variable assignment
- Java – read all the files and folders in a certain directory and three methods to get the file name from the file path
- Compare whether two sets are the same in Java
- C++ string substr()
- Empty Matrices, Scalars, and Vectors
- Java.lang.Character . isdigit() and isletter() methods
- Difference between isempty method and isblank method in stringutils
- The differences between the equals method in the string class and the equals method in the object class
- Remove video with video byte 0, uncaught (in promise) domexception: failed to load because no supported source was f
- Matlab error “Object returned error code of the xlswrite function: 0x800A03EC
- C / C + + rounding function ceil(), floor ()
- Error analysis of swap file “*. SWP” already exists! When editing files with VIM
- C# SevenZip simple operation
- [depth concept] · introduction of EER (equal error rate)
- New fields in hive table and modification of field comments
- Delete the specified crontab timer task under Linux
- ES6 determines what the string begins with or ends with
- panic: runtime error: index out of range