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.

1 Answer 1

1

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 Commented Nov 25, 2020 at 7:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .