Skip to content

Instantly share code, notes, and snippets.

@tuffacton
Created November 9, 2017 22:25
Show Gist options
  • Save tuffacton/a2d5cac69f6c813b534ab000d5687a2c to your computer and use it in GitHub Desktop.
Save tuffacton/a2d5cac69f6c813b534ab000d5687a2c to your computer and use it in GitHub Desktop.
Quick shell commands to retrieve and download pdfs from a document containing online links.
# Strip URLs from a file (in this case, a markdown file called Notes.md)
# Append to a working file called link_list.txt
$ grep -o 'https://[^)]*.pdf' Notes.md > link_list.txt
# Download all pdfs from the list you created
$ wget -i ../links_list.txt
# You might have odd filenames, use rename to rename them
# Syntax:
$ rename [options] 's/old/new' files
# For example, the following will rename all .perl files to .pl
$ rename 's/perl/pl/' *.perl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment