Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a litle question how I can download files from un file called "X". In file "X" I have the name for many files and need download with mget the files that are listing in "X".
Hi people,
I have a litle question how I can download files from un file called "X". In file "X" I have the name for many files and need download with mget the files that are listing in "X".
I tried with:
mget X
mget !cat X
mget !X
You don't provide any details (version/distro of Linux, which FTP server and client, etc.), so its hard to say. If you're asking how to script this, you can write a bash/expect script that loops through your input file, and gets them one at a time. You *REALLY* shouldn't be using FTP anyway, as it's slow and insecure. If you use SCP, you can simply do a keyswap with your remote host, and type in
As a pure guess, how about you get X, and then parse X to get the rest of the files.
Further, it's worth looking at scp as well as the -r option.
mget for FTP is only something you can use with a wildcard, like "mget *" or "mget *.jpg"
You can read my bash blog, (link in my signature) for some bash tips. A primary point I make is that if you can type it, you can script it. So, figure out what to type to accomplish this and then script it. We can help you with improving the efficiency of a script once you show us on. If you don't now how to script much at all, then please start a bit before attempting something more complex.
In file X is the list for all files in a directory
Ok, so back to "write a script to loop through that, and get the files". What have you done so far? And as we've said, consider scp with the usage mentioned.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.