TransWikia.com

Recently downloaded files using wget

Unix & Linux Asked by Mohammad Qodrati on December 17, 2020

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.

One Answer

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.

Correct answer by rishang bhavsar on December 17, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP