How To Use ncftp in Linux
ncftp is a ftp program that comes with most linux distributions. This
program is accessed from the shell prompt, and gives you a good deal of control
over managing your files on your web and especially your CGI server.
Logging Into Your Web or CGI Server
If you are in X-Windows, you can get to ncftp by clicking on your program menu
button (the first icon in the lower left of your screen). Then go into the
System menu, then the Terminal menu, and click on Konsole or
other terminal program.
Now that you are at the shell prompt, type in: ncftp
You are now in the ftp program. To log in, you need to give the program your
username and password as well as your server hostname. Below are examples of
what to type in depending on the server you need to log into. Note that you should
replace all occurances of yourdomain.com with your actual domain name. In
any of the examples below, italics inside monospaced type means that you will
have to substitute the text for your own file, directory, domain name, etc.
whichever is appropriate.
open -p your_ftp_password -u yourdomain.com ftp.yourdomain.com
open -p your_cgi_password -u yourdomain.com cgi.yourdomain.com
List All Files (including .htaccess and other hidden files):
Upload a File:
Download a File:
NOTE: When you download a file, it will automatically be placed in the same
directory you were in before you started the ncftp program.
Set Mode to ASCII:
Set Mode To Binary:
To delete a file:
Managing and Changing Directories
To rename a file:
rename oldfile newfilename
Change to a Directory:
Change to Previous Directory:
Create a Directory:
Remove a Directory:
NOTE: Make sure the directory is completely empty first. You may be puzzled
if you see it's empty but still get errors that it can not be deleted. Change to
the directory and do a
ls -a to find any hidden files and delete
them before you move back out of the directory and delete it.
List Files and Show Permissions:
Saving Your Site Login
NOTE: When using
ls -l the permissions will show up as letters
and possibly dashes, and not numbers that you would be instructed to set in a script.
The 'd' is for directory. 'r' means readable, 'w' means writeable, and 'x' means
eXecutable. The first set of 3 on the left (after the first dash or 'd') shows
the owner (your) permissions. The second set of 3 shows the group permissions and
the last set of 3 letters shows the public permissions.
Change File Permissions:
chmod numbers filename
NOTES: The numbers represents the numbers you're instructed to
change the file permissions to. For example 755 or 666.
You can save your site login at any time by typing
Logging Out and Exiting
then following the prompts to name and save your site. This way you do not have
to retype all the information to log in again. You can access these bookmarks
while not connected to a server by typing
(Note that an 's' is added at the end.)
NOTE: If you didn't already save a bookmark, you'll be asked if you want
to before you are logged out.
Exiting the ncftp Program:
NOTE: If you are in X-Windows, you may have to type exit again to exit
the terminal window as well.