Listing only file name of files in remote

#1

While using rclone lsf --files-only it produces

rootfolder/folder2/filename1.pdf
rootfolder/folder3/filename2.pdf
rootfolder/folder4/folder5/filename3.pdf

I would like to have just the list of files

filename1.pdf
filename2.pdf
filename3.pdf

While it is possible to filter the output of rclone, it is complex.

I read all I could but did not find a native rclone only solution.
Is there any way to do that?

I am aware that there can be files with same name. The ideal solution would be to have path and filename, but not in the same string …

TIA

0 Likes

#2

Rclone doesn’t do that right now. Should be easy to parse though.

rclone lsf remote: --files-only --recursive 2>&1 | sed 's!.*/!!'
1 Like

#3

Thanks!

being a windoze I always forget about sed… I was trying to parse it using just pure cmd commands…

1 Like

#4

What are you doing with just the file names?

0 Likes

#5

I am feeding filename and its mega publiclink to a sqlite3 to handle assets, so I can send a pdf with name and link to relatives… So, end product is not needing the full path, althought I will keep it in the DB as reference. I use md5 of filename as index so removing the path is interesting, althougth this is transitory cause I plan to use the file md5 instead.

0 Likes