Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
File test statement
files used in the test parameters
whether the file is a directory type -d test
whether the test -e file exists
-f file to determine whether the general
-r test whether the current user has permission to read
-w test whether the current user has write permissions
- x test whether the current user has permission to execute
ls -l display in the first column r, w, x are read write and execute permissions.
Logic test statement parameters