Some months ago I recovered all my photos and videos from a large 4TB drive. They are on a NAS. They are grouped in folders by extension. I have one folder called 'ts' with a few million of mostly small .ts files. Most of them probably will be useless, but the size of the folder is around 50GB, so there could be still some useful files in there. I thought I use SSH find the largest files and move them somewhere else to check them out. Accessing the folder via SMB or in the browser hasn't given me any results as loading the files never ends.
What would be the best way to find the largest file using SSH? Other strategies are welcome to.
.ts
files" – Removing files that are way too small may be a good preliminary step. (2) Do you really want to find largest file(s)? Or files large enough?find
ing files with size above some threshold does not require sorting. Review them, then lower the threshold and repeat. (3) Forls -S *.ts
the argument list is created by the shell and it may be too long. Forls -S .
the argument list is short and fixed. What command did you use exactly?ls
butmv
for trying to move some of the files to another folder. I will try Artem's answer first and if it takes too long, I will remove a bunch of small files first. That is a very good suggestion, thank you.find . -type f -size -100k -delete
. Will find delete whilst finding the files or will it look for the files first and then delete them one by one?