Remove downloaded URLs from a text file
up vote
0
down vote
favorite
I have a text file containing a bunch of URLs (more like 500 or more), now I used wget to download few files and I want to remove URL of the files downloaded from the text file.
bash 18.04 wget
New contributor
|
show 2 more comments
up vote
0
down vote
favorite
I have a text file containing a bunch of URLs (more like 500 or more), now I used wget to download few files and I want to remove URL of the files downloaded from the text file.
bash 18.04 wget
New contributor
1
What does a URL look like in the file?
– waltinator
Nov 25 at 16:24
Like a normal urlhttp://something.deb
and one line per url
– harshit
Nov 25 at 16:44
Is the URL a whole line.
– Hobbyist
Nov 25 at 17:01
Please provide a sample of the text including these URLs!
– George Udosen
Nov 25 at 17:14
Here is the link to [sample] (paste.ubuntu.com/p/tXSGK6yqY4)
– harshit
Nov 25 at 17:25
|
show 2 more comments
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a text file containing a bunch of URLs (more like 500 or more), now I used wget to download few files and I want to remove URL of the files downloaded from the text file.
bash 18.04 wget
New contributor
I have a text file containing a bunch of URLs (more like 500 or more), now I used wget to download few files and I want to remove URL of the files downloaded from the text file.
bash 18.04 wget
bash 18.04 wget
New contributor
New contributor
New contributor
asked Nov 25 at 16:19
harshit
278
278
New contributor
New contributor
1
What does a URL look like in the file?
– waltinator
Nov 25 at 16:24
Like a normal urlhttp://something.deb
and one line per url
– harshit
Nov 25 at 16:44
Is the URL a whole line.
– Hobbyist
Nov 25 at 17:01
Please provide a sample of the text including these URLs!
– George Udosen
Nov 25 at 17:14
Here is the link to [sample] (paste.ubuntu.com/p/tXSGK6yqY4)
– harshit
Nov 25 at 17:25
|
show 2 more comments
1
What does a URL look like in the file?
– waltinator
Nov 25 at 16:24
Like a normal urlhttp://something.deb
and one line per url
– harshit
Nov 25 at 16:44
Is the URL a whole line.
– Hobbyist
Nov 25 at 17:01
Please provide a sample of the text including these URLs!
– George Udosen
Nov 25 at 17:14
Here is the link to [sample] (paste.ubuntu.com/p/tXSGK6yqY4)
– harshit
Nov 25 at 17:25
1
1
What does a URL look like in the file?
– waltinator
Nov 25 at 16:24
What does a URL look like in the file?
– waltinator
Nov 25 at 16:24
Like a normal url
http://something.deb
and one line per url– harshit
Nov 25 at 16:44
Like a normal url
http://something.deb
and one line per url– harshit
Nov 25 at 16:44
Is the URL a whole line.
– Hobbyist
Nov 25 at 17:01
Is the URL a whole line.
– Hobbyist
Nov 25 at 17:01
Please provide a sample of the text including these URLs!
– George Udosen
Nov 25 at 17:14
Please provide a sample of the text including these URLs!
– George Udosen
Nov 25 at 17:14
Here is the link to [sample] (paste.ubuntu.com/p/tXSGK6yqY4)
– harshit
Nov 25 at 17:25
Here is the link to [sample] (paste.ubuntu.com/p/tXSGK6yqY4)
– harshit
Nov 25 at 17:25
|
show 2 more comments
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
Let's say you have a bunch of deb files. And in the same directory you have a text file named file_list
where each line is a download link for all of those deb files. We can get the names of all of deb files using glob pattern (*deb) and using for loop we use sed to remove matched line in-place of the file_list
:
for i in *deb;
do
sed -i "/"$i"/d" file_list
done
Just to be safe, copy the file_list
first before you run the command.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
Let's say you have a bunch of deb files. And in the same directory you have a text file named file_list
where each line is a download link for all of those deb files. We can get the names of all of deb files using glob pattern (*deb) and using for loop we use sed to remove matched line in-place of the file_list
:
for i in *deb;
do
sed -i "/"$i"/d" file_list
done
Just to be safe, copy the file_list
first before you run the command.
add a comment |
up vote
1
down vote
accepted
Let's say you have a bunch of deb files. And in the same directory you have a text file named file_list
where each line is a download link for all of those deb files. We can get the names of all of deb files using glob pattern (*deb) and using for loop we use sed to remove matched line in-place of the file_list
:
for i in *deb;
do
sed -i "/"$i"/d" file_list
done
Just to be safe, copy the file_list
first before you run the command.
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Let's say you have a bunch of deb files. And in the same directory you have a text file named file_list
where each line is a download link for all of those deb files. We can get the names of all of deb files using glob pattern (*deb) and using for loop we use sed to remove matched line in-place of the file_list
:
for i in *deb;
do
sed -i "/"$i"/d" file_list
done
Just to be safe, copy the file_list
first before you run the command.
Let's say you have a bunch of deb files. And in the same directory you have a text file named file_list
where each line is a download link for all of those deb files. We can get the names of all of deb files using glob pattern (*deb) and using for loop we use sed to remove matched line in-place of the file_list
:
for i in *deb;
do
sed -i "/"$i"/d" file_list
done
Just to be safe, copy the file_list
first before you run the command.
answered Nov 26 at 13:38
aasril
1015
1015
add a comment |
add a comment |
harshit is a new contributor. Be nice, and check out our Code of Conduct.
harshit is a new contributor. Be nice, and check out our Code of Conduct.
harshit is a new contributor. Be nice, and check out our Code of Conduct.
harshit is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1095948%2fremove-downloaded-urls-from-a-text-file%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
What does a URL look like in the file?
– waltinator
Nov 25 at 16:24
Like a normal url
http://something.deb
and one line per url– harshit
Nov 25 at 16:44
Is the URL a whole line.
– Hobbyist
Nov 25 at 17:01
Please provide a sample of the text including these URLs!
– George Udosen
Nov 25 at 17:14
Here is the link to [sample] (paste.ubuntu.com/p/tXSGK6yqY4)
– harshit
Nov 25 at 17:25