1.

Explain any one File Search command.

Answer»

File Search Command find: This command recursively examines the specified directory tree to look for files matching some file attributes, and then takes some specified action on those files.

Syntax ⇒ find [path-list] [selection-criteria] [action]

selection – criteria

  • – name < filename > ⇒ selects the file specified.
  • – user < username > ⇒ selects files owned by user.
  • – type d ⇒ selects directories.
  • – size ⇒ selects files that are greater than/less than ‘n’ blocks (1 block = 512 bytes)
  • – mtime < n/+n/-n > ⇒ selects files that have been modified on exactly n days/more than n days/less than n days.

Examples:

⇒ find/home/Harsh – name “*.cpp” – print find /home /Harsh -m time 5 – print Here print action will print the file on the screen.



Discussion

No Comment Found