I have a list of files with the following names:
document1
document2
document3
..
document41
document42
document43
To check all the all document space, I could use du -sh file*. I am trying to access documents from document1 to document 10. I tried the following:
du -sh document[1-10]
But it returns document 28 and document 15. I would like to know how could I access a range of files with document name from document1 to document10?
In bash:
Only existing files numbered 1-10 will be passed to
du.Regular sh doesn't have nullglob. If a pattern doesn't match, it's passed literally. This causes either a file not found error, or importantly, a non matching file to be passed (ie. an existing file literally named
document1[0]).