Find the answer to your Linux question:
Results 1 to 2 of 2
I've got some problems with my file system that I won't go into, but what I'd like to know is what files can't be read. When I do du /foo ...
  1. #1
    Just Joined!
    Join Date
    Nov 2004
    Posts
    3

    piping errors to a file

    I've got some problems with my file system that I won't go into, but what I'd like to know is what files can't be read. When I do

    du /foo -h

    I get a list of all the files, and size, in foo. But I also get an error whenever a file can't be read (Input/Output error). When I do this:

    du /foo -h >file.lst

    only the good files get listed. Is there some way to get the errors all in one file? I'd like a list of all the files that elicit IO errors.

    Thanks.

  2. #2
    Linux Engineer rcgreen's Avatar
    Join Date
    May 2006
    Location
    the hills
    Posts
    1,114
    Code:
    du /foo -h 2>file.lst
    The 2> redirects standard error output to the file.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...