Alternative to unix du to determine the size of a folder in the RAP

Hi everyone,

We have generated quite a bit of data in the RAP and we now need to download it to process it further. However, I'm not entirely sure we currently have sufficient storage space to handle it fully, so I intended to check the size of the folder containing all files. Without “du” available, is there any way to determine the size of a folder, either through dx or on the web interface?

Cheers,

Fran

Comments

3 comments

  • Comment author
    Rachael W The helpers that keep the community running smoothly. UKB Community team Data Analyst

    You could try a combination of dx ls to get all the filenames and dx describe to get the size of each file.

    I don't know if there is a better way.

    0
  • Thanks Rachael. Inspired by your answer, I think the most suitable option at the moment is something like:

    dx ls -l <FOLDER> > <FILE>
    tail -n +4 d2.txt | awk -F' ' '{sum+=$4;} END{print sum;}'

    as long as all files are expressed in the same size magnitude (e.g., MB)

    otherwise, it will need to be a bit more complicated

    0
  • Comment author
    Rachael W The helpers that keep the community running smoothly. UKB Community team Data Analyst

    Nice!

    I'm not very good with unix commands, so I would probably have had to read the file into R to do the sum.

    If you wanted the contents of subfolders, you could use dx tree.

    If there are any small items, it will at least give an upper limit by assuming they are all MB.

    0

Please sign in to leave a comment.