Shell Test Value string file comparison

Source: Internet
Author: User

A comparison of the numerical values Describe
N1–eq N2 As
N1–GT N2 Greater than
N1–ge N2 Much more than
N1–lt N2 Less than
N1–le N2 As small as
N1–ne N2 Not equal to

string comparison Describe
STR1 = str2 As
Str1! = str2 Not equal to
STR1 < STR2 Less than (must be used by definition)
str1 > STR2 Greater than (must be used by definition)
-N str1 Whether the length is not 0
-Z str1 is the length 0

File comparison Describe
-D File A catalogue?
-E File Exist?
-F File File?
-R File exist and can read?
-S file Existence is not empty?
-W File exist and can write?
-X File exists and is available to execute?
-0 file A former user?
-6 file is the default value the same as the previous user?
File1–nt File2 File1 is newer than file2
File1–ot File2 is file1 better than file2?

Shell Test Value string file comparison

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.