![]() ![]() The final action in the above command works like find with the -exec ls -dils action. The first file has the SGID permission set, and the second file has the SUID permission set. ![]() You can also see the differences in permissions. In the above command, you can see the use of escaped parentheses. They are set to allow ordinary users on a computer system access to execute binary executables with temporarily elevated privileges.įind / \( -perm -2000 -o -perm -4000 \) -lsġ67901 12 -rwsr-xr-x 1 root root 9340 /usr/bin/rshġ67334 12 -rwxr-sr-x 1 root tty 10532 /usr/bin/wall The SGID and SUID are special access right flags that can be assigned to files and directories on a UNIX-based operating system. OK, now we can address that extra leading permission mentioned at the beginning of this section. It could be used, however, to identify files without a user or group, perhaps after moving files around. The above command might not actually yield results on your system. This next command identifies files that do not have a listing in the /etc/passwd or /etc/group file: find / -nouser -o -nogroup To find the appropriate uid or gid, you can run the more or cat command on the /etc/passwd or /etc/group file.īeyond finding files of specific known users and groups, you may also find it useful to look for files lacking either of these. This command will yield a list of directories owned by group ID 100. Here is a severely abbreviated sample of the output of such a command: # find /usr/bin -type l -name "z*" -exec ls -l \ Running the following three find commands will all yield the same results-a full listing of all files in the current directory and all subdirectories including hidden files: If you do not specify a test condition, an option, or a value to be matched your results will be either incomplete or indiscriminating. name \*.javaĪlthough all arguments to find are optional, the search will begin by default in the current directory if you do not specify where to begin searching. So, put your search string in quotes, or precede it with a backslash: find. In either case, you need to escape the wildcard character to be sure it passes to the find command and is not interpreted by the shell. The following command will do the same thing. REGEXPvalidate/src/oracle/otnsamples/plsql/DBManager.java REGEXPvalidate/src/oracle/otnsamples/plsql/ConnectionManager.java ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |