# Am i Doing this wrong ?

## gentoo_newguy

Ok im pretty sure im doing this write but obviously not.

Im tring to ftp a log file to my webspace 

I have emerged gftp and ftp

i can connect to my ftp space fine with no problems I have been going through the man pages for hours tring to work this out on both of them.

Once logged in i do the ls command.

i can see the directory which i created earlier on. 

now from what i can gather in the man pages it tells me to do this 

put /var/log/logfilename.log /fiiles

"files is the directory i created on remote server"

Can anyone tell me if this is write or wrong or the right way of doing this .

Thanx and appricate all the help i can get on this oneLast edited by gentoo_newguy on Wed May 16, 2007 12:37 am; edited 1 time in total

----------

## techie705

Is it possible to copy paste like this?

```

May 10 15:48:02 a28 kernel: Linux version 2.6.18 (root@a28) (gcc version 4.1.1 (Gentoo 4.1.1-r3)) #1 PREEMPT Thu May 10 11:30:14 CDT 2007

May 10 15:48:02 a28 kernel: BIOS-provided physical RAM map:

May 10 15:48:02 a28 kernel:  BIOS-e820: 0000000000000000 - 000000000009f800 (usable)

May 10 15:48:02 a28 kernel:  BIOS-e820: 000000000009f800 - 00000000000a0000 (reserved)

May 10 15:48:02 a28 kernel:  BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)

May 10 15:48:02 a28 kernel:  BIOS-e820: 0000000000100000 - 000000003fee0000 (usable)

May 10 15:48:02 a28 kernel:  BIOS-e820: 000000003fee0000 - 000000003fee3000 (ACPI NVS)

May 10 15:48:02 a28 kernel:  BIOS-e820: 000000003fee3000 - 000000003fef0000 (ACPI data)

May 10 15:48:02 a28 kernel:  BIOS-e820: 000000003fef0000 - 000000003ff00000 (reserved)

May 10 15:48:02 a28 kernel:  BIOS-e820: 00000000fec00000 - 00000000fec01000 (reserved)

May 10 15:48:02 a28 kernel:  BIOS-e820: 00000000fee00000 - 00000000fef00000 (reserved)

May 10 15:48:02 a28 kernel:  BIOS-e820: 00000000fefffc00 - 00000000ff000000 (reserved)

May 10 15:48:02 a28 kernel:  BIOS-e820: 00000000ffff0000 - 0000000100000000 (reserved)

May 10 15:48:02 a28 kernel: 126MB HIGHMEM available.

May 10 15:48:02 a28 kernel: 896MB LOWMEM available.

```

Or maybe I don't understand   :Question: 

----------

## gentoo_newguy

Hi basicaly i cant copy or paste im on a machine with no graphics 

im using the forum through the command line using the links web browser.

Does anyone no a way of ftping a file from the command line.

----------

## techie705

It sounds ok, This is what I do with ftp at the cli.

```
admin@a28 ~ $ ftp

ftp> open

(to) ip addy

331 Password required for troyt75.

Password:

230 User troyt75 logged in.

Remote system type is UNIX.

Using binary mode to transfer files.

ftp> ls

200 PORT command successful.

150 Opening ASCII mode data connection for '/bin/ls'.

total 18

-rw-r--r--  1 troyt75  dialer  767 Jan 10  2006 .cshrc

-rw-r--r--  1 troyt75  dialer  248 Jan 10  2006 .login

-rw-r--r--  1 troyt75  dialer  158 Jan 10  2006 .login_conf

-rw-r--r--  1 troyt75  dialer  373 Jan 10  2006 .mail_aliases

-rw-r--r--  1 troyt75  dialer  331 Jan 10  2006 .mailrc

-rw-r--r--  1 troyt75  dialer  797 Jan 10  2006 .profile

-rw-r--r--  1 troyt75  dialer  276 Jan 10  2006 .rhosts

-rw-r--r--  1 troyt75  dialer  975 Jan 10  2006 .shrc

drwxr-xr-x  3 troyt75  dialer  512 May 12 16:35 htdocs

226 Transfer complete.

ftp> mkdir tmp

257 "tmp" directory created.

ftp> ls

200 PORT command successful.

150 Opening ASCII mode data connection for '/bin/ls'.

total 20

-rw-r--r--  1 troyt75  dialer  767 Jan 10  2006 .cshrc

-rw-r--r--  1 troyt75  dialer  248 Jan 10  2006 .login

-rw-r--r--  1 troyt75  dialer  158 Jan 10  2006 .login_conf

-rw-r--r--  1 troyt75  dialer  373 Jan 10  2006 .mail_aliases

-rw-r--r--  1 troyt75  dialer  331 Jan 10  2006 .mailrc

-rw-r--r--  1 troyt75  dialer  797 Jan 10  2006 .profile

-rw-r--r--  1 troyt75  dialer  276 Jan 10  2006 .rhosts

-rw-r--r--  1 troyt75  dialer  975 Jan 10  2006 .shrc

drwxr-xr-x  3 troyt75  dialer  512 May 12 16:35 htdocs

drwxr-xr-x  2 troyt75  dialer  512 May 15 20:01 tmp

226 Transfer complete.

ftp> cd tmp

250 CWD command successful.

ftp> put

(local-file) /home/admin/temp/mail

(remote-file) mail

local: /home/admin/temp/mail remote: mail

200 PORT command successful.

150 Opening BINARY mode data connection for 'mail'.

226 Transfer complete.

302 bytes sent in 5.1e-05 secs (5.8e+03 Kbytes/sec)

ftp> ls

200 PORT command successful.

150 Opening ASCII mode data connection for '/bin/ls'.

total 2

-rw-r--r--  1 troyt75  dialer  302 May 15 20:03 mail

226 Transfer complete.

ftp> close

221 Goodbye.

ftp> quit

admin@a28 ~ $ 
```

Hope this helps.   :Smile: 

----------

## gentoo_newguy

Thanx man il give that a bash 

Appricate the help so much

----------

## jstead1

Nothing to do with the problem, but if you want to cut and paste in a non-graphics environment, you can use gpm, as long as you have a mouse.  Kinda handy for just this sort of thing.

----------

## nephros

ncftp is a nice advanced text-based ftp client.

It also provides the ncftpput and ncftpget commands so you can push and pull from FTP servers from the command line/scripts.

Just a general caveat when using FTP: Always be wary if you are using ASCII or Binary mode when transferring files.

Using ASCII with anything that is not text will corrupt the file on the FTP server in the process (this is because ASCII mode tries to mangle the encoding of the files it transfers). 

(Likewise, Text files might end up unreadable on the server when transferred in Binary mode - but this is only likely to happen when the client and server systems are very different (e.g. a mainframe server and UNIX client), and also only relevand when one tries to open said file on the server system.)

----------

