Parameter description of if in shell

  
 

[ -a FILE ] True if FILE exists. [ -b FILE ] True if FILE exists and is a block special file. [ -c FILE ] True if FILE exists and is a word special file. [ -d FILE ] True if FILE exists and is a directory. [ -e FILE ] True if FILE exists. [ -f FILE ] True if FILE exists and is a normal file. [ -g FILE ] True if FILE exists and SGID is already set. [ -h FILE ] True if FILE exists and is a symbolic link. [ -k FILE ] True if FILE exists and a sticky bit has been set. [ -p FILE ] True if FILE exists and is a name pipe (F if O). [ -r FILE ] True if FILE exists and is readable. [ -s FILE ] True if FILE exists and the size is not 0. [ -t FD ] True if the file descriptor FD is open and points to a terminal. [ -u FILE ] True if FILE exists and SUID (set user ID) is set. [ -w FILE ] True if FILE exists if FILE exists and is writable. [ -x FILE ] True if FILE exists and is executable. [ -O FILE ] True if FILE exists and is a valid user ID. [ -G FILE ] True if FILE exists and is a valid user group. [ -L FILE ] True if FILE exists and is a symbolic link. [ -N FILE ] True if FILE exists and has been mod if ied since it was last read. [ -S FILE ] True if FILE exists and is a socket. [ FILE1 -nt FILE2 ] If FILE1 has been changed more recently than FILE2, or if FILE1 exists and FILE2 does not true. [ FILE1 -ot FILE2 ] True if FILE1 is older than FILE2, or if FILE2 exists and FILE1 does not exist. [ FILE1 -ef FILE2 ] True if FILE1 and FILE2 point to the same device and node number. [ -o OPTIONNAME ] True if the shell option "OPTIONNAME" is turned on. [ -z STRING ] "STRING" is zero if the length is true. [ -n STRING ] or [ STRING ] "STRING" is non-zero and non-zero is true. 0 [ STRING1 == STRING2 ] If 2 strings are the same. "=" may be used instead of "==" for strict POSIX compliance is true. [ STRING1 != STRING2 ] True if the strings are not equal. [ STRING1 < STRING2 ] True if "STRING1" sorts before "STRING2" lexicographically in the current locale. [ STRING1 > STRING2 ] True if "STRING1" sorts after "STRING2" lexicographically in the current locale. [ ARG1 OP ARG2 ] "OP" is one of -eq, -ne, -lt, -le, -gt or -ge. These arithmetic binary operators return true if "ARG1" is equal to, not equal to, less Than, less than or equal to, greater than, or greater than or equal to "ARG2", respectively. ARG1 and ARG2 are integers.find . -size +500000000c -type f

Copyright © Windows knowledge All Rights Reserved