Linux Command Line Basics Tutorials - Wget command in Linux

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
particular video we are going to learn about the most interesting command that is the double gate command okay so basically we use this command to download files from the servers or from any website suppose in case if you want to download any kind of PNG or you want to download any kind of PDF or you can say uh also if you want to mirror the website it means you want to download the whole website their whole file that is htmlc is a JavaScript all those well if you want to download okay so in this case you can do all those operations using this single command that is a w get command okay so uh let's start now with the implementation part that is uh double get and the whatever the URL you want okay and just first I will give you the syntax so syntax is nothing but W gate options and whatever the URL uh you want to provide it can be a URL of any file or anything else okay so now moving forward uh what are the protocols that width command supports so it supports http https that is the high for text transfer protocol secure and FTP file transfer protocol so these are the some protocols which are used by the duplicate command so HTTP runs on Port 80 https runs on Port 443 and FTP on Port 21. okay now moving forward uh let me increase the font size 4 so that it should it should be visible to you guys okay now now what I will do I will try to search for image I have already searched I think okay so Linux PNG let me copy this image address or let me do here also I will choose this one image okay let's check let me check open image in new tribe okay um yeah this one is good copy image address and here duplicate and the oh my god let's let's see what happens let's see just file name is too long okay so let's take some another image uh okay let me search for from here I will choose okay okay I think this one should be no not this one open image in new tab okay copy image address now let's check so here right now I'm not providing any kind of options so it will just store my file in this current working directory but before I will just create a one directly W gate tutorial I will create okay I will move into that particular directory and I will again enter the command that is W get and the this one link so here you can see it is downloading my file okay now I will do LS and here you can see my file has been downloaded okay now to uh see the image file uh there is a separate command that is a fee but it is you need to install first you can do like sudo apt install fee I know I don't know the pronunciation of this command but it can it could be something like that so as you can see phase already newest version so now what I will do I will just say and the file name what it was I think L something yeah so you can see file has been downloaded okay cool now you can easily download the files uh it can be used in some kind of automation things okay if you want but manually we download files from our web web browser but in some cases we could we can use wget command also so now moving forward uh we will uh see the uh like uh what like here you can see uh the name of the file is so big okay if you want to uh like name it some different names okay I will then for that we use capital O that is hyphen capital O option and then we will use the new name that I will provide this Linux PNG image okay and the URL let's check okay I will do LS and here you can see Linux PNG image I have not added dot PNG let me add it first okay dot PNG oh sorry sorry sorry sorry PNG done okay let me do LS and now I will use Linux PNG not this one Linux image Linux what is the name it is Linux PNG image yeah okay so here you can see uh we have changed the name of the uh like file this so this like earlier it was a long string like the next pen doing Vector graphic pixel B all those things but now we can easily change the name of that particular file okay so moving forward uh you can use the different options like hyphen P option to uh like save the file in a particular directory in which you want so I will go just move back one directory and uh no let me PWD I will do and I will just copy the whole path here first okay if I'm not copy uh doesn't matter let's now I am in which directory I'm in this home I use directory okay now what I will do I will just like I want to CMI file in this particular directory okay but before that I will just remove those files uh PDW get RM iPhone audio star okay it's not destroy it's basically asterisk we say let me close this terminal now what you want to do you have to just to give the whole path of this particular like location so I will just provide this hyphen p and this one and the link so I will just copy this one link okay done it should be yes so now I will move back into this directory W get I'll do LS and here you can see the same image okay we have downloaded so using hyphen P option you can save your file into some another directory okay so now moving forward uh Suppose there is some conditions like if you are downloading multiple files or anything else and you have a limited bandwidth or limited internet connection or you can say limited net you have like these days we use 1.5 GB per days and all those things so in this case you want to limit your bandwidth or Internet like two like we we don't want to like w get to consume more amount of net okay so for this we use the uh hyphen hyphen limit hyphen rate option and we provide the what should be the minimum amount of the net used by this wget command so for this what we will do duplicate hyphen iPhone limit hyphen rate equal to one M1A means one may be 1 MB and K means KB and all okay and the URL we will provide unless now or just uh use some different uh image or not this one here this one I was learning what how I can see the image okay and this is not necessary okay move back move back uh let's download this Spiderman Spiderman okay so this one is so like it's great image looking beautiful ah copy image address if I will do like it's on Splash image uh no I don't want this link let me open up this one open image in new tab okay uh if I will click on download free whether I will get some link or not if I will copy this one let's see what happens okay it's downloading now it means we have copied the correct link now what I will do I will just to paste the URL and we are done and also I will provide the iPhone option to change the file name iPhone capital O file name should be Spider-Man dot PNG enter okay I'm getting some kind of error let me to control CLS something cat look at log let's see what's going on okay saving a spiderman.png okay let me again run the program or you can use hyphen C option to uh what we can say to resume uh hyphen C I think it's uh small C let me check and again I will just open up some another terminal to check the W get lock file if I get the same error again c d w get URL LS and Trail hyphen f w bit log okay and let me just again run this command okay foreign log.1 okay let me just Ctrl C and W get when it is I think LS uh jail iPhone okay connecting to onesplus.com so here you can see we can see the live uh whatever the background process going on you we can see this like this using tail command okay so w get comma W get log basically provides the log okay whatever it's going on okay so I don't think it is getting connected I'm getting some kind of error maybe it could be network error let me just close the connection I will use some different uh different image not for months plus okay Wikipedia is there let me open image in new tab I need a short link just okay just search for Linux only okay and this one let me check let me close all these sites okay let's move back I think it's taking so much time Open Image new tab no Linux PNG well here it's still opening man how much time it will take uh let me pause the video uh okay so I was getting a network error at that time uh now it has been resolved so here we can see uh like the log file of this one W get DOT log dot one okay so you can see the file is already fully retrieved okay so uh now I will just check again so here you can see the image I think it's too large to display here okay that's why we are not uh able to see it so in this case if you want to limit your bandwidth you can use the limit hyphen hyphen uh hyphen iPhone limit hyphen rate equal to whatever the uh amount you want to give like uh it could be 1 MB 1 KB or anything it's all depends upon you and your internet connection and similarly using hyphen C we just checked we can do Zoom any uh like uh any download which is not complete or if like similarly I just got the network error so I can resume using iPhone C option okay now moving forward uh if you want to download some file in the background process okay so in that time we use the hyphen B option that is this one hyphen B option we will use and also the W get log file will be created similarly like this like this one W get log and W get log.1 okay similarly this file will be generated and we can see the whatever the process going on and all those things so now moving forward I will just download one PDF I will just search for us uh file type this is Linux Google docking we call it if you use this kind of searches file type I will just type uh um let's type linux.pdf I hope my connection internet should work okay again I'm getting a ride on to let me pause the video okay now I'm done I'll now finally it's working let me just search for uh file type I will just use uh let's just search similar like this file type PDF uh colonizers let me write the file name also so that it could be easy so here you can see there is one PDF file introduction to Linux this one okay tldp.org this is some kind of I don't know which website is I will just copy this one move back to our terminal just LS remove everything whatever we have uh downloaded till now okay RM iPhone RF forcefully we removed everything clear the screen also W get hyphen B and the particular link or URL you can say so now in this case what will happen the log file will be created okay so I will just enter and what it's saying continuing in background P ID is this output will be written to W get hyphen log okay LS I will just use tail hyphen f w kit and here you can see all done we have finally downloaded this one I think let me do LS and let me go into the file section file system open tutorial okay here you can see the file so in the background process what happens uh the file all the process whatever going on is getting stored in this W get hyphen log file okay I hope it is clear to you so here you can see all the process like oh this is like how much bits of data and all those things the IP address from where it is resolving it is connected on which Port that is 443 that is the https and saving which file that is into linux.pdf file that's saving okay so I hope that is clear to you it should be clear to you okay so moving forward let me just close one this clear the screen and now we will move forward and we will uh if you want to download some multiple files suppose you both give your task and give you the links and he's saying you download one by one by one but uh you know the feature of this W get command you can download multiple files easily so how you can do it let's do cat let me I will just create one file that is cat uh books.txt okay and I will just hit the first link and let me go for second one okay this one it should work let's check Okay Internet bro yeah working finally okay second file um okay done we will just save only this on file control Ctrl D to save okay now done let me check the first text whether it is correct or not yeah clear and LS I will just remove all those files sorry my phone RF now there is nothing else so which option we use to download multiple files you use obligate hyphen I and the file name but where is file name let me oh I just deleted the file name also no problem let me create again Ctrl shift V and here also uh this one yeah Ctrl C okay just paste it here Ctrl D to save now we are done clear W get hyphen iBook Dot txt hyphen I okay resolving this one connecting to this particular website fetching news for beginners fetching and root intro Linux dot PDF file okay so in this case you can download multiple files you let me check with ls command and yeah done here you can see both the files has been downloaded finally okay so these are some of the features which we learned about till now okay so now in the next video we will see the the most interesting part of this wget command which will be covered in our next videos so till now we will stop here and thank you thank you for watching and if you have any questions please ask us in the comment section guys thank you thank you for watching and we'll meet in the next one
Info
Channel: ProgrammingKnowledge
Views: 3,751
Rating: undefined out of 5
Keywords: wget command not found, wget vs curl, wget command in windows, wget command in linux with username and password, wget alternative, man wget, wget get request, wget download, wget command line options​, wget command windows​, how to use wget linux​, wget output file​, wget examples linux​, what is wget command​, what is wget​, linux man wget​
Id: uLA1ielCU1k
Channel Id: undefined
Length: 20min 29sec (1229 seconds)
Published: Sat Oct 29 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.