DISQUS

Tech-Recipes: Find a file by name in UNIX/Solaris/Linux | UNIX | Tech-Recipes

  • snarfel · 1 year ago
    so, i get a bunch of "Permission Denied" notices for directories that my current user account can't access. is there a way to suppress these?
  • Quinn McHenry · 1 year ago
    Yeah, totally. Normal output goes to "standard output" which can be redirected with normal measures. It's actually a nice thing that those messages are sent to "standard error" so you can redirect those but keep the more interesting responses.

    find / -name something 2> /dev/null
  • venkata sudheer · 1 year ago
    try this # find <folder path> -name <filename> -print
  • Jesse F. · 11 months ago
    His problem is is that he doesn't have permissions to view a lot of the files 'find' uses. Here's a few options:
    If you don't have root permission, then you can supress error messages like so: 'find -ignore_readdir_race /parent/path/here -name file_name.txt'
    Or if you can get permission, then: 'sudo find /parent/path/here -name file_name.txt'

    yay!