1252748
1252748

Reputation: 15372

get size of many files at once

I've found that I can print a list a directories total size with

du -sb myDirectory

Is there anyway I can apply this same command to an array of directories du -sb (myDirectory yourDirectory hisDirectory)?

Upvotes: 0

Views: 60

Answers (3)

RydallCooper
RydallCooper

Reputation: 21184

Specify everything including the sub-directories with:

du -sb */*

Upvotes: 0

glenn jackman
glenn jackman

Reputation: 246837

Just list the dirs

du -sb myDirectory yourDirectory hisDirectory

Note how the man page says:

du [OPTION]... [FILE]...

That's what the [FILE]... means.

If you want to examine all the directories in the current directory

du -sb */

Upvotes: 3

Reinstate Monica Please
Reinstate Monica Please

Reputation: 11593

Try

du -sb {myDirectory,yourDirectory,hisDirectory}

Upvotes: 1

Related Questions