How to use sort?

I am trying to list the contents of a directory and sort them, and to do this, I am using the command

rclone lsd "GSuite_Crypt:Dropbox" | sort -k 2

to sort the output of lsd by name. When I run this command, however, I get the error:

Input file specified two times

Am I doing something wrong here? What does this mean?

Looks good to me:

felix@gemini:~$ rclone lsd GD: | sort -k 2
          -1 2019-09-29 21:57:58        -1 crypt
          -1 2020-03-10 05:20:13        -1 test

How come it throws an error? I don't understand why it complains if that should work.

What's the output of that command without the sort? Does it work?

Removing the sort works, yes. It lists the directories like I'd expect

works for me

user01@EN07:/mnt/c/data/rclone/scripts$ rclone lsd wasabieast2: | sort -k 2
          -1 2019-10-18 15:14:53        -1 vserver03
          -1 2019-12-23 11:30:52        -1 vserver03-bjv.h.vserver03.g.ampe01
          -1 2020-01-16 12:05:36        -1 encbucket
          -1 2020-02-17 11:20:38        -1 handbrake01
          -1 2020-03-16 19:27:17        -1 thetestbucket
          -1 2020-03-22 13:32:45        -1 en07

what version of rclone are you using?

I'm using version 1.51.0

What OS are you using?

1 Like

I'm using Windows 10

that command will not work on windows as is, as it is written to be used on linux.
you need to tweak it.

if you install WSL - windows subsystem for linux, then you can run it

Ah, OK. I didn't know there were commands in rclone that were Linux specific.

rclone works the same on windows and linux.

however, the sort command, that is not part of rclone but the underlying operating system.

Oh, it's a Linux thing. OK.

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