0

I am using Linux Mint. There are several years worth of files and folders scattered everywhere.

My goal is to find a way to search my entire hard drive for any video files that were created on a Saturday, I do not know the date in number format. I do not know the file name, nor the file extension, but they were certainly videos.

I am preferably looking for a GUI program where I can see a thumbnail of the video file, to save me from having to manually open each one. But, failing that a command line solution is also okay.

1 Answer 1

2

The simplest way I can think of is filtering find from the command line, printing both the date and the filename in an easily parsed format, then extracting the filenames again:

find /home/lserni -type f \( -name "*.avi" -or -name "*.mkv" \) \
    -printf "%a|%h/%f\n" | grep "^Sat" | cut -f2- -d'|'

You might possibly create a folder, then in this folder run ln:

... | xargs -n 1 -I '{}' ln -s "{}"

Now you have a folder with links to all the Saturday videos, that you can perhaps view in the GUI. On the same device (if the folder and the videos are on the same partition) you can even run ln "{}" instead of ln "{}", and that will surely work in the GUI (i.e. you'll be able to view thumbnails etc), and it will have the correct dates etc..

Keep in mind that in both cases, deleting a file in that folder will not delete the original it is linked to.

2
  • So I can just run the first find command and wait for the results to be printed out to the console? I think it is not working, as nothing gets found and I certainly have .mkv files created on Saturdays. Keeping in mind, the Saturday might have been back in 2017 and 2018. Dec 15, 2021 at 22:10
  • Try running first the find alone to more (maybe on a smaller directory where you're sure of the contents): find /var/my/small/directory -type f \( -name "*.avi" -or -name "*.mkv" \) -printf "%a|%h/%f\n" | more . See what happens. Fact is that %a prints the date in the default locale, so on my system it would report Sab (sabato) instead of Sat (saturday). By looking at the output you can verify what is actually getting returned.
    – LSerni
    Dec 16, 2021 at 11:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.