LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Help with FTP?? (https://www.linuxquestions.org/questions/linux-newbie-8/help-with-ftp-651522/)

your_shadow03 06-25-2008 06:10 AM

Help with FTP??
 
I want to know how ftp works.
I have to fetch few files through ftp from the remote machine.
I am able to connect to remote system through ftp.But donno How gonna I enter into his directory and fetch the file.
Is there any particular location i should place the files.Whenever I ftp to the remote machine on successful login its throwing me into pub directory.
On remote system where is this pub directory located??

Pls Help?

watcher69b 06-25-2008 06:30 AM

the pub directory is in
/var/ftp/pub

to get files download gFTP and use that. it is a GUI app that makes FTP very easy.

tronayne 06-25-2008 06:35 AM

It's probably a good idea (just because it's a little easier) to be in the directory on your machine that you want to copy files from a remote machine into (although you can change local directory in ftp, it's just easier to be in the directory before you start).

To connect to a remote machine, you just do
Code:

ftp -i remote
where remote is either a URL; e.g., ftp.remote.com or remote.com, or a address; e.g., 192.168.1.10.

You use the -i so you can get (or put) multiple files easily.

Now, the above only connects you to the machine and you need to cd (change directory) to the directory where the files are on the remote and you have to have permission to do so (granted by the administrator of the remote); if the files you want are in the /tmp directory, you should be able to cd /tmp. You most likely will not be able to cd /home/user, though, so have the remote copy the files to someplace you can get to (frequently that would be /pub/some_directory -- you need to know where that is).

So, assuming you can get into the directory, you can see the content of the directory with
Code:

ls
Then you would get the files you want with
Code:

get file01 file02 ...
Or, if the files have similar names (that you would list with ls *name* or something similar, you can
Code:

mget *name*
(that's why the -i -- mget is multiple-get; you could do mget * to get every file in the directory).

So, to cut to the chase,
Code:

ftp -i remote
cd directory
ls
mget pattern
or
get file1 file2 ...
^D

Home this helps.

your_shadow03 06-25-2008 07:17 AM

Thanks Tronyne...Great Stuffs.


All times are GMT -5. The time now is 11:38 PM.