Author Topic: The "du" command and file-list [SOLVED]  (Read 1297 times)

0 Members and 1 Guest are viewing this topic.

Offline Keith

  • Hero Member
  • *****
  • Posts: 864
  • Karma: 11
  • Gender: Male
  • Linux Novice
    • View Profile
    • Awards
The "du" command and file-list [SOLVED]
« on: December 01, 2018, 04:17:16 pm »
I use the "du" command quite a lot - it's very useful.  Better still:  one can read from a file a list of files/directories for which one wants a size summary. 
The Man pages offer the option:
--files0-from=F
              summarize  disk usage of the NUL-terminated file names specified in file F

I tried creating a simple list containing one file or directory per line but this doesn't work. 
I guess the clue is in the "NUL-terminated file names specified in file" requirement but I can't discover from Google just what a NUL-terminated file name is. 
Can anyone advise me, please?

Found a solution!
     du -sh `cat <file-name-path>`
Hope this helps others, although it would still be nice to understand the proper "du" option. 
« Last Edit: December 01, 2018, 08:30:13 pm by Keith »

Offline Keith

  • Hero Member
  • *****
  • Posts: 864
  • Karma: 11
  • Gender: Male
  • Linux Novice
    • View Profile
    • Awards
Re: The "du" command and file-list [SOLVED]
« Reply #1 on: December 05, 2018, 12:18:25 pm »
.............. but there are a few quirks to the "cat" method:
I have found that the file list can be in any directory as long as the listed files/directories are in the current directory.

If anyone has used the "--files0-from=F" du option successfully, I would be grateful for advice.
« Last Edit: December 05, 2018, 12:52:49 pm by Keith »

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal