Skip to content

Instantly share code, notes, and snippets.

@CyberSecutor
Last active July 17, 2024 14:48
Show Gist options
  • Save CyberSecutor/72e9df46b7e0e4a4a62bac87c254de27 to your computer and use it in GitHub Desktop.
Save CyberSecutor/72e9df46b7e0e4a4a62bac87c254de27 to your computer and use it in GitHub Desktop.
Usefull bash scripts/commands

This file has some usefull commands in bash that I may need again.

Download all images from a list and put them in a directory structure following the URL path:

$ for i in `cat ~/imageList-karrepad.txt`; do echo $i | perl -e 'while (<>) {chomp $_; $url = $_; $path = $url; $path =~ s/.*\:\/\/(.*)\?.*/$1/g; system ("mkdir -p `dirname $path` 2> /dev/null") == 0 or die "failed to create $path. exiting...\n"; print "$url -O $path\n"; }' | xargs wget; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment