0

How to find a list of recently modified files on the Ubuntu server 18.04? Specifically, I need a list of recently downloaded files using wget.

0

If you have used wget command to download files, you can check history command to list out all the previously used commands and use grep "wget" to list out whenever wget command was used.

history | grep "wget" | grep -E "(\-[PO])|(\-\-output-document|\-\-directory-prefix)"

here: "(\-[PO])|(\-\-output-document|\-\-directory-prefix)" means grep any of the following below

  • -P or --directory-prefix in wget refers to directory path where file has to be downloaded
  • -O or --output-document refers to save to directory with specific file name

If the wget command was used in some bash script you can cat the script and follow the same method

cat script.sh | grep "wget" | grep -E "(\-[PO])|(\-\-output-document|\-\-directory-prefix)"

from the output of that you can figure out where all the files downloaded using wget must have been stored.

1
  • 1
    Use grep pattern file instead of cat file | grep pattern, and save typing
    – roaima
    Nov 25 '20 at 7:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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