Frankly, this looks like absolute beginner level homework to me.
First of all, I don't think any of this will work for lines that start with a '-' (minus).
Then, are you asking us how to add lines of text to a file? You can use your favorite editor, or sth like 'echo "blabla" >> file' or 'cat' etc. etc.
Or are you asking about the pattern? Read 'man du', skip to PATTERNS.
Quote:
Originally Posted by lqchoo
I have a list of pattern that I want to exclude when running du.
> du --exclude-from EXCLUDE.TXT myfolder/
How should I add these patterns to the EXCLUDE.TXT file?
-/myfolder/...randomsubfolderlevel.../sub/*.gz
-/myfolder/...randomsubfolderlevel.../sub3/
-/myfolder/...randomsubfolderlevel../sub1/file1
-/myfolder/...randomsubfolderlevel.../sub2/sub1a/*_file1.txt
-/myfolder/...randomsubfolderlevel.../sub2/sub2/newlog_*/folder1/
-/myfolder/...randomsubfolderlevel.../sub2/sub2a/oldlog_*/file1
-/myfolder/...randomsubfolderlevel.../sub2/sub2a/subfolder/oldfolder_*/
|