Unix find command's Predicates
Matching the
find
command predicates to descriptions of what they would find. Here are the correct answers:
-type d
: All directories
-perm 755
: Permission = rwxr-xr-x
-atime +7
: No match (This would find all files last accessed more than 7 days ago.)
-mtime +7
: Files last modified more than a week ago
-perm -002
: “Other” write permission is set
-type f
: No match (This would find all “regular” files.)
To look for all the occurrences of getrlimit in the man pages on our system, we could use
find /usr/share/man -type f -print | xargs grep getrlimit
If the man pages on our system are compressed, however, we could try
find /usr/share/man -type f -print | xargs bzgrep getrlimit
We use the type -f option
to the find command to restrict the list so that it contains
only regular files, because the grep commands cannot search for patterns in directories, and we want to avoid unnecessary error messages.
It has been mentioned that the process ID does not change after an exec, but the new program inherits additional properties from the calling process:
- Process ID and parent process ID
- Real user ID and real group ID
- Supplementary group IDs
- Process group ID
- Session ID
- Controlling terminal
- Current working directory
- Root directory
- File mode creation mask
- File locks
- Process signal mask
- Pending signals
- Resource limits
- Values for tms_utime, tms_stime, tms_cutime, and tms_cstime