Active Web Hosting Logo


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.

Web Server: open -p your_ftp_password -u yourdomain.com ftp.yourdomain.com

CGI Server: open -p your_cgi_password -u yourdomain.com cgi.yourdomain.com
Listing Contents:
List Files: ls

List All Files (including .htaccess and other hidden files): ls -a
Transferring Files
Upload a File: put path_and_filename_of_file_to_upload

Download a File: get file_to_download

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: ascii

Set Mode To Binary: binary
Managing Files
To delete a file: rm filename

To rename a file: rename oldfile newfilename

Managing and Changing Directories
Change to a Directory: cd directory_name

Change to Previous Directory: cd ..

Create a Directory: mkdir directory_name

Remove a Directory: rmdir directory_name

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.
File Permissions
List Files and Show Permissions: ls -l

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.
Saving Your Site Login
You can save your site login at any time by typing bookmark and 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 bookmarks. (Note that an 's' is added at the end.)
Logging Out and Exiting
Log Out: bye

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: exit

NOTE: If you are in X-Windows, you may have to type exit again to exit the terminal window as well.

 


Home - Support - Management - About Us
... Active Web Hosting, 1445 American Pacific Dr. Ste 110-318, Henderson, NV 89074 ...
Toll-Free (800) 946-7764   Fax: (702) 567-1831