How to learn, use the good shell

Source: Internet
Author: User


Shell in the large data domain is an essential tool, how to learn how to use a good shell, start with a simple command


If [-Z "$DIRNAME"] what does this-Z mean?


File operations like this are useful in shell programming: I've summed up some of the things that are often used
-D: Determine whether the set is a directory
-Z: Determine if a variable exists with a value
-F: Judge whether a file is made
-L: Determine if a symbolic link is made
-R: Determining whether the made is readable
-S: Determine if the existing object length is 0
-W: Judge whether the formulated can be written
-X: Determines whether an existing object can be executed
。 : Negative sign of test condition
These file operations are often convenient for scripting, especially if they are used in an IF condition statement









































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.