DistributedNetworks DistributedNetworks


Special File Types  «Prev  Next»

Unix find command's Predicates

Matching the find command predicates to descriptions of what they would find. Here are the correct answers:
  1. -type d: All directories
  2. -perm 755: Permission = rwxr-xr-x
  3. -atime +7: No match (This would find all files last accessed more than 7 days ago.)
  4. -mtime +7: Files last modified more than a week ago
  5. -perm -002: “Other” write permission is set
  6. -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:
  1. Process ID and parent process ID
  2. Real user ID and real group ID
  3. Supplementary group IDs
  4. Process group ID
  5. Session ID
  6. Controlling terminal
  7. Current working directory
  8. Root directory
  9. File mode creation mask
  10. File locks
  11. Process signal mask
  12. Pending signals
  13. Resource limits
  14. Values for tms_utime, tms_stime, tms_cutime, and tms_cstime