Ubuntu: edit ftp file via ubuntu terminal?



Question:

I'm connecting my website via $ ftp command. I want to edit some files via nano or gedit.
But When I enter nano filename.php bash returns ?Invalid Command.

How can i edit files via using ubuntu terminal?


Solution:1

There are multiple options for Ubuntu on how to do this. If you want to do this using a GUI you could simply open Nautilus and connect a server of the type of FTP.

If you want to do it through a shell you could mount it using ftpfs, which is one of my favorite ways since I get the controls as if it were local files.

To do so:
$ sudo apt-get install curlftpfs

After the install of curlftpfs type:
$ mkdir -p ~/mnt/ftpfs
$ curlftpfs <username>@<server> ~/mnt/ftpfs
$ cd ~/mnt/ftpfs/
$ ls

You should now be able to list your files.

Kind regards,
Jochen


Solution:2

The "!" command in BSD FTP is meant to give you a shell on your local machine.

You cannot use it to run commands on the remote machine - that would make absolutely no sense security wise, for starters.

However, you can search for an editor that can pull and push the files you wish to edit from the FTP server in a transparent fashion if you are bothered by the constant get-ting and put-ting.

I seem to recall BBEdit for Mac OS 9 did it back then, for example.

Emacs Can Probably Do It (tm).


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »