How to perform grep on FTP?
Clash Royale CLAN TAG#URR8PPP
up vote
10
down vote
favorite
I tried searching for similar command in ncftp
(actually this is the only terminal ftp client I used) and I didn't find it.
What's the way (if possible at all) to use grep
command on remote server, to search for strings in files?
command-line grep search ftp
add a comment |
up vote
10
down vote
favorite
I tried searching for similar command in ncftp
(actually this is the only terminal ftp client I used) and I didn't find it.
What's the way (if possible at all) to use grep
command on remote server, to search for strings in files?
command-line grep search ftp
Also related: Search Within Files On Remote FTP Site - Stack Overflow
– sdaau
Mar 2 '14 at 18:18
add a comment |
up vote
10
down vote
favorite
up vote
10
down vote
favorite
I tried searching for similar command in ncftp
(actually this is the only terminal ftp client I used) and I didn't find it.
What's the way (if possible at all) to use grep
command on remote server, to search for strings in files?
command-line grep search ftp
I tried searching for similar command in ncftp
(actually this is the only terminal ftp client I used) and I didn't find it.
What's the way (if possible at all) to use grep
command on remote server, to search for strings in files?
command-line grep search ftp
command-line grep search ftp
edited Jun 15 '15 at 19:06
cuonglm
101k23195296
101k23195296
asked Apr 2 '12 at 12:02
Bojan Savic
51113
51113
Also related: Search Within Files On Remote FTP Site - Stack Overflow
– sdaau
Mar 2 '14 at 18:18
add a comment |
Also related: Search Within Files On Remote FTP Site - Stack Overflow
– sdaau
Mar 2 '14 at 18:18
Also related: Search Within Files On Remote FTP Site - Stack Overflow
– sdaau
Mar 2 '14 at 18:18
Also related: Search Within Files On Remote FTP Site - Stack Overflow
– sdaau
Mar 2 '14 at 18:18
add a comment |
5 Answers
5
active
oldest
votes
up vote
5
down vote
The standard ftp protocol does not allow it (You can check the list of commands). So you would have to download everything just to be able to grep on it.
add a comment |
up vote
5
down vote
You can use curlftpfs to mount remote ftp as local disk and manipulate with files as on your local machine.
2
As with everything which is mount based, this implies that you will transfer the whole data to your own host.
– Stéphane Gimenez
Apr 2 '12 at 12:27
1
Yes it will. But it also depends on task you need to perform. When you need grep something in the most cases you can ignore nontext files (and they won't be transfer) and maybe part of text files. So in this case your sum transfer size may be lower than in case you'll transfer the whole data from the remote site.
– rush
Apr 2 '12 at 12:45
add a comment |
up vote
4
down vote
You should localy mount the remote FTP directory to do this, however, be warned that all the files you grep will need to be downloaded for this operation.
SSH into the remote machine and run grep through there, if possible, to save bandwidth.
add a comment |
up vote
0
down vote
Assuming you are using simple ftp via command line,
Use dir command with -Rl option to search recursively and copy it to a file and then search the file using grep, find or whatever way is supported on your OS.
ftp> dir -Rl education.txt
output to local-file: education.txt? y
227 Entering Passive Mode (9,62,119,15,138,239)
150 Opening ASCII mode data connection for file list
226 Transfer complete
add a comment |
up vote
0
down vote
By using lftp
First grab everything from ftp to file
$ lftp http://downloads.site.com/sources> find . > sources-list.txt
Next perform grep on file:
$ grep FILE sources-list.txt
add a comment |
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
down vote
The standard ftp protocol does not allow it (You can check the list of commands). So you would have to download everything just to be able to grep on it.
add a comment |
up vote
5
down vote
The standard ftp protocol does not allow it (You can check the list of commands). So you would have to download everything just to be able to grep on it.
add a comment |
up vote
5
down vote
up vote
5
down vote
The standard ftp protocol does not allow it (You can check the list of commands). So you would have to download everything just to be able to grep on it.
The standard ftp protocol does not allow it (You can check the list of commands). So you would have to download everything just to be able to grep on it.
answered Apr 2 '12 at 12:19
Stéphane Gimenez
19k15074
19k15074
add a comment |
add a comment |
up vote
5
down vote
You can use curlftpfs to mount remote ftp as local disk and manipulate with files as on your local machine.
2
As with everything which is mount based, this implies that you will transfer the whole data to your own host.
– Stéphane Gimenez
Apr 2 '12 at 12:27
1
Yes it will. But it also depends on task you need to perform. When you need grep something in the most cases you can ignore nontext files (and they won't be transfer) and maybe part of text files. So in this case your sum transfer size may be lower than in case you'll transfer the whole data from the remote site.
– rush
Apr 2 '12 at 12:45
add a comment |
up vote
5
down vote
You can use curlftpfs to mount remote ftp as local disk and manipulate with files as on your local machine.
2
As with everything which is mount based, this implies that you will transfer the whole data to your own host.
– Stéphane Gimenez
Apr 2 '12 at 12:27
1
Yes it will. But it also depends on task you need to perform. When you need grep something in the most cases you can ignore nontext files (and they won't be transfer) and maybe part of text files. So in this case your sum transfer size may be lower than in case you'll transfer the whole data from the remote site.
– rush
Apr 2 '12 at 12:45
add a comment |
up vote
5
down vote
up vote
5
down vote
You can use curlftpfs to mount remote ftp as local disk and manipulate with files as on your local machine.
You can use curlftpfs to mount remote ftp as local disk and manipulate with files as on your local machine.
answered Apr 2 '12 at 12:24
rush
19k45994
19k45994
2
As with everything which is mount based, this implies that you will transfer the whole data to your own host.
– Stéphane Gimenez
Apr 2 '12 at 12:27
1
Yes it will. But it also depends on task you need to perform. When you need grep something in the most cases you can ignore nontext files (and they won't be transfer) and maybe part of text files. So in this case your sum transfer size may be lower than in case you'll transfer the whole data from the remote site.
– rush
Apr 2 '12 at 12:45
add a comment |
2
As with everything which is mount based, this implies that you will transfer the whole data to your own host.
– Stéphane Gimenez
Apr 2 '12 at 12:27
1
Yes it will. But it also depends on task you need to perform. When you need grep something in the most cases you can ignore nontext files (and they won't be transfer) and maybe part of text files. So in this case your sum transfer size may be lower than in case you'll transfer the whole data from the remote site.
– rush
Apr 2 '12 at 12:45
2
2
As with everything which is mount based, this implies that you will transfer the whole data to your own host.
– Stéphane Gimenez
Apr 2 '12 at 12:27
As with everything which is mount based, this implies that you will transfer the whole data to your own host.
– Stéphane Gimenez
Apr 2 '12 at 12:27
1
1
Yes it will. But it also depends on task you need to perform. When you need grep something in the most cases you can ignore nontext files (and they won't be transfer) and maybe part of text files. So in this case your sum transfer size may be lower than in case you'll transfer the whole data from the remote site.
– rush
Apr 2 '12 at 12:45
Yes it will. But it also depends on task you need to perform. When you need grep something in the most cases you can ignore nontext files (and they won't be transfer) and maybe part of text files. So in this case your sum transfer size may be lower than in case you'll transfer the whole data from the remote site.
– rush
Apr 2 '12 at 12:45
add a comment |
up vote
4
down vote
You should localy mount the remote FTP directory to do this, however, be warned that all the files you grep will need to be downloaded for this operation.
SSH into the remote machine and run grep through there, if possible, to save bandwidth.
add a comment |
up vote
4
down vote
You should localy mount the remote FTP directory to do this, however, be warned that all the files you grep will need to be downloaded for this operation.
SSH into the remote machine and run grep through there, if possible, to save bandwidth.
add a comment |
up vote
4
down vote
up vote
4
down vote
You should localy mount the remote FTP directory to do this, however, be warned that all the files you grep will need to be downloaded for this operation.
SSH into the remote machine and run grep through there, if possible, to save bandwidth.
You should localy mount the remote FTP directory to do this, however, be warned that all the files you grep will need to be downloaded for this operation.
SSH into the remote machine and run grep through there, if possible, to save bandwidth.
answered Apr 2 '12 at 18:50
WhyNotHugo
22517
22517
add a comment |
add a comment |
up vote
0
down vote
Assuming you are using simple ftp via command line,
Use dir command with -Rl option to search recursively and copy it to a file and then search the file using grep, find or whatever way is supported on your OS.
ftp> dir -Rl education.txt
output to local-file: education.txt? y
227 Entering Passive Mode (9,62,119,15,138,239)
150 Opening ASCII mode data connection for file list
226 Transfer complete
add a comment |
up vote
0
down vote
Assuming you are using simple ftp via command line,
Use dir command with -Rl option to search recursively and copy it to a file and then search the file using grep, find or whatever way is supported on your OS.
ftp> dir -Rl education.txt
output to local-file: education.txt? y
227 Entering Passive Mode (9,62,119,15,138,239)
150 Opening ASCII mode data connection for file list
226 Transfer complete
add a comment |
up vote
0
down vote
up vote
0
down vote
Assuming you are using simple ftp via command line,
Use dir command with -Rl option to search recursively and copy it to a file and then search the file using grep, find or whatever way is supported on your OS.
ftp> dir -Rl education.txt
output to local-file: education.txt? y
227 Entering Passive Mode (9,62,119,15,138,239)
150 Opening ASCII mode data connection for file list
226 Transfer complete
Assuming you are using simple ftp via command line,
Use dir command with -Rl option to search recursively and copy it to a file and then search the file using grep, find or whatever way is supported on your OS.
ftp> dir -Rl education.txt
output to local-file: education.txt? y
227 Entering Passive Mode (9,62,119,15,138,239)
150 Opening ASCII mode data connection for file list
226 Transfer complete
edited Jun 15 '15 at 18:48
Anthon
59.6k17101162
59.6k17101162
answered Jun 15 '15 at 18:44
SmitaK
1
1
add a comment |
add a comment |
up vote
0
down vote
By using lftp
First grab everything from ftp to file
$ lftp http://downloads.site.com/sources> find . > sources-list.txt
Next perform grep on file:
$ grep FILE sources-list.txt
add a comment |
up vote
0
down vote
By using lftp
First grab everything from ftp to file
$ lftp http://downloads.site.com/sources> find . > sources-list.txt
Next perform grep on file:
$ grep FILE sources-list.txt
add a comment |
up vote
0
down vote
up vote
0
down vote
By using lftp
First grab everything from ftp to file
$ lftp http://downloads.site.com/sources> find . > sources-list.txt
Next perform grep on file:
$ grep FILE sources-list.txt
By using lftp
First grab everything from ftp to file
$ lftp http://downloads.site.com/sources> find . > sources-list.txt
Next perform grep on file:
$ grep FILE sources-list.txt
answered 2 days ago
cy8g3n
216
216
add a comment |
add a comment |
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%2funix.stackexchange.com%2fquestions%2f35538%2fhow-to-perform-grep-on-ftp%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
Also related: Search Within Files On Remote FTP Site - Stack Overflow
– sdaau
Mar 2 '14 at 18:18