How show ls size in "MB"

Hi, i need to know if possible list files and show the size of them in MB or GB, only show in bytes

Here one example of command im using: list files, and filtering
rclone ls MyDrive:PelisFolder --fast-list- --include"word"

You could do something like this as I'm not aware of a way to change the units in the ls command:

felix@gemini:/gmedia/Movies/Unsane (2018)$ rclone ls gcrypt:Movies/"Unsane (2018)" |  awk '{ byte =$1 /1024/1024**2 ; print byte" " $2 }'
24.157 Unsane
felix@gemini:/gmedia/Movies/Unsane (2018)$ du -ms Unsane\ \(2018\).mkv
24737	Unsane (2018).mkv

That's in GB.

Works thanks! i
@ncw do you think is possible add this feature (show in GB when we use rclone ls ) in the next update of rclone please.

Maybe you could try to mount the remote and see what the ls command can for do you.

Like these options from ls?

       -h, --human-readable
              with -l and -s, print sizes like 1K 234M 2G etc.

       --si   likewise, but use powers of 1000 not 1024
1 Like

Yes, like when we use "du" on linux
du /homeFolder
102411

du -h /home/Folder
1.0GB

On rclone will like this
rclone ls -h mydrive1:Folder

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.