PDA

View Full Version : Using Terminal as FTP



Bandersnatch
6th August 2006, 10:32 AM
Hi all

I have Googled with no luck to find a tutorial on how to use Terminal as an FTP client. I know nothing about using Terminal and thought that this might be a good way to start.

I looked in Terminal Help and tried File > Connect to server but wasn't sure what I was doing and chickened out. I feel blonder than usual.

I am just wanting to upload files to my ISP's free webspace. I used to use Fetch in back the the days of Classic but haven't done any FTPing since.

Thanks for any pointers!

Bandersnatch

dev_enter
6th August 2006, 10:44 AM
You can type man ftp in Terminal.app to get some more information.
Or you can run ftp, then hit ? to get a listing of all the commands and help command to get information on a command (e.g. help lcd)

The commands I use most are:
cd - change directory on server (e.g. cd public_html)
lcd - change local directory (e.g. lcd Sites)
ascii - change to ascii mode (for uploading text files)
binary - change to binary mode (for uploading binary files such as images)
put - put a named file onto the server (e.g. put index.html)
mput - put multiple files onto the server (e.g. mput followed by *.html)
bye - disconnect from ftp server
ls - list the contents of the current directory

pipsqeek
6th August 2006, 11:53 AM
Just as an example. I use Terminal.app for FTP services and here's what I do.

ftp domain.com.au <hit enter>
username: <duh>
password: <your password>

And you should be logged in. From then on use Bahamut&#39;s list of commands, and that&#39;s pretty much all you need to know.

pipsqeek

konni
1st November 2006, 12:13 PM
I've stuffed up my forum upgrade (PHPBB2) - you don't want to know... but anyway... I have to start again with a full install, but I can't delete 2 empty folders on the host server.

I've tried Fetch 4.0.3 and Dreamweaver. I get an FTP error, directory not empty. I've tried putting folder/file of same name, permissions 777. Nothing works.

Can I do something using terminal?
Or should I ignore it and just go ahead and do the new upload/install?
Any suggestions at this stage would be welcome. I drew a blank from PHPBB2 support.

purana
1st November 2006, 12:39 PM
Sounds like the 2 folders are indeed not empty, very likely contain files... and if so, probably files that start with a . and as such some clients will not display, until you tell them to show hidden files (hidden files on unix are those that start with a ., ie. .htaccess is a well known example of a file in a web directory to start with a .)

konni
1st November 2006, 02:13 PM
ok. downloaded Cyberduck (thanks Spectre) and there were no hidden files. Deleted the folders without any problems. ADVICE - old FTP programs are old and don't cut it.

purana
1st November 2006, 02:33 PM
ok. downloaded Cyberduck (thanks Spectre) and there were no hidden files. Deleted the folders without any problems. ADVICE - old FTP programs are old and don't cut it.

CLI ftp is fine for uploading or downloading a single file (or a few files in the same directory).

Anything more then this, and you should use one of the many GUI kinds, as it makes it easier doing group actions (like uploading many files and folders). Not to mention removing folders/files. As any good GUI client will change in the directory you want to remove, look for any files (including hidden ones) remove the files first, then the directory. Solving any problems trying to remove folders.

The only time removing a folder will fail is you don't have ownerhsip to said folder.

Good luck with that reinstall of your forum software. Certainly going to take a little bit of time and effort (like anything in this world).