Linux shell:test Command parameter resolution

Source: Internet
Author: User

Transfer from http://blog.chinaunix.net/uid-21961753-id-1810588.html

format: Test conditionstest-n string:string not empty
test-z string:string is empty
Test Int1-eq int2:int1 = = int 2
Test Int1-ne int2:int1! = Int2
test int1-gt int2:int1 > Int2
test Int1-ge int2:int1 >= int2
Test Int1-lt int2:int1 < Int2
test Int1-le int2:int1 <= int2test-r FileName: User has Read permission to file filename
test-w FileName: User has write permission to file filename
test-x FileName: User has executable permissions on file filename
test-f FileName: file filename is a normal file
test-d FileName: file filename for directory
test-c FileName: file filename is a character device file
test-b FileName: file filename is a block device file
test-s FileName: file filename size is not zero
test-t Fnumb: The device associated with the file descriptor Fnumb (default = 1) is a terminal equipmentTest!-S empty:empty is emptytest-a: and
Test-o: OrNote that the test command and the [] brackets function the same:

Linux shell:test Command parameter resolution

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.