In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you "Linux system test command how to use", the content is easy to understand, clear, hope to help you solve doubts, the following let the editor lead you to study and learn "Linux system test command how to use" this article.
In the Linux system, the test command is used to check whether a condition is true. It can perform numeric values, characters, and files.
The test flag represents the meaning file name and file type
-e whether the file name exists-f whether the file name exists and file-d whether the file name exists and is a directory-b whether the file name exists and is a block-c whether the file name exists and is a character device device-S whether the file name exists and is a socket file-p whether the file name exists and is a FIFO (pipe) file-L whether the file name exists and detects for a connection file permission
-r detect the existence of the file name and have "readable" permission-w detect whether the file name exists and have "writable" permission-x detect the existence of the file name and have "executable" permission-u detect the existence of the file name and have the "SUID" permission-g detect the existence of the file name and have the "SGID" permission-k detect the existence of the file name and have the "Sticky bit" permission- S to detect whether the file name exists and the comparison between two files that are "non-blank files"
-nt (newer than) to determine whether file1 is newer than file2-ot (older than) to determine whether file is older than file2-ef to judge whether file1 and file2 are the same file, which can be used to determine whether numbers are on hard link.
-eqequal-nenot equal-gtgreater than-ltless than-gegreater than or equal-leless than or equal determines the data of the string
Test-z string determines whether the string is 0, if empty returns truetest-n string to determine whether the string is 0, if empty returns falsetest str1 = str2 to determine whether str1 is equal to str2, if equal, returns truetest str1! = str2 to determine whether str1 is equal to str2, if equal, returns the judgment of false multiple conditions
-a two conditions hold at the same time, eg:test-r file a test-x file, at the same time set up return true-o any condition holds, eg:test-r file o test-x file, while set up return true! Reverse state, such as test! -x file, when file does not have x, return true above is all the content of this article "how to use test commands in Linux system". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.