Ability to sort file list with ls command

When I execute the ls command, my files are not listed in alpha-numeric order.
Is there a way to sort the file list? I’m not finding seeing any obvious ways to sort the files by name.

rclone streams the file names in multiple threads so they appear somewhat at random.

In the next version you’ll get each directory in alphabetical order, but the order of the directories will still be random.

You can always use sort

Ah, yes. Thank you.
For a future reader, I sorted the file list by piping the output to sort. Use the -k option to sort by file size (1) or file name (2).

rclone ls horelS3:Bucket/path/to/files/ | sort -k 2

and just for reference you can also do the same for directories with

rclone lsd googledrive:/path/to/files/ | sort -k 4


In linux you could take advantage of ncdu, it is a disk usage analyzer for headless systems, the combination of rclone mount and this tool is amazing.

rclone mount remote:path /localPath
ncdu /localPath

1 Like

ncdu is one of my favourite tools. I was thinking of making an rclone ncdu remote: command if I have a rainy day some time!

1 Like