4

I have an directory structure like this:

  1. application1
  2. application1_edit
  3. application2
  4. application2_edit

Is there any way to get the total size for every folder (including sub-directories) and exclude all folders with _edit in name?

I have tried du -s on the root folder, but it lists all sub-directories.

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
opHASnoNAME
  • 197
  • 1
  • 7

1 Answers1

5

Something like this should do it.

$ du -s application[12]

Example

$ ls -l
total 16
drwxrwxr-x 2 saml saml 4096 Nov 28 01:51 application1
drwxrwxr-x 2 saml saml 4096 Nov 28 01:51 application1_edit
drwxrwxr-x 2 saml saml 4096 Nov 28 01:51 application2
drwxrwxr-x 2 saml saml 4096 Nov 28 01:51 application2_edit

Disk usage:

$ du -s application[12]
4   application1
4   application2
slm
  • 363,520
  • 117
  • 767
  • 871