The contents of the shell command

Source: Internet
Author: User
Tags locale sorts

[ -a file] is true if file exists. [ -b file] True if file exists and is a block special file. [ -c file] True if file exists and is a word special. [ -d file] True if file exists and is a directory. [ -e file] is true if file exists. [ -f file] True if file exists and is a normal file. [ -g file] True if file exists and Sgid has been set. [ -h file] True if file exists and is a symbolic connection. [ -k file] True if file exists and the sticky bit has been set. [ -p file] If file exists and is a name pipe (f if O) is true. [ -r file] True if file exists and is readable. [ -s file] True if file exists and the size is not 0. [ -t FD] True if the file descriptor fd is open and points to a terminal. [ -u file] True if file exists and suid (Set user ID) is set. [ -w file] True if file exists and is writable. [ -x file] True if file exists and is executable. [ -o file] True if file exists and is a valid user ID. [ -g file] True if file exists and is a valid user group. [ -l file] True if file exists and is a symbolic connection. [ -n file] If file exists  and has Been mod if IED since it is last read is true. [ -s file] True if file exists and is a socket. [File1 -nt FILE2] If FILE1 have been changed more recently than file2, or  if FILE1 exists and fILE2 Doesnot is true. [File1 -ot FILE2] If FILE1 is older than FILE2, or FILE2 exists and FILE1 does not exist, it is true. [File1 -ef FILE2] True if FILE1 and FILE2 point to the same device and node number. [ -o Optionname] true if the shell option "Optionname" is turned on. [ -z STRING] "STRING" is true if the length is zero. [ -n string] or [string] "string" is true if the length is not 0 non-zero. [String1 == string2] If 2 strings are the same. "=" may be used instead of  "= ="  for strict POSIX compliance is true. [STRING1!= string2] True if the strings are not equal. [String1 < string2] If "STRING1" sorts before "STRING2" Lexicographically in the current The locale is true. [String1 > string2] If "STRING1" sorts after "STRING2" lexicographically in the the current The locale is true. [ARG1 OP ARG2] "OP" is one of-eq, -ne, -lt, -le, -gt or-ge. These arithmetic binary operators return true if "ARG1" is equal to, not equal to, less than, Less than or equal to, Greater Than, or greAter than or equal to "ARG2", respectively. "ARG1"  and  "ARG2" are integers.  these file operations are often convenient for scripting, especially if they are used in an IF condition statement

Contents of the shell command

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.