Trending
  • How to Turn the Dock and Folders to Black on Your iPhone
    How to Turn the Dock and Folders to Black on Your iPhone
  • How to Send a Zip File via Email, Facebook
    How to Send a Zip File via Email, Facebook
  • How to use Siri on iPhone, Apple TV, Mac
    How to use Siri on iPhone, Apple TV, Mac
  • How to Delete Google Plus (+) From Your Goole Account
    How to Delete Google Plus (+) From Your Goole Account
  • Security Settings You Should Have on Your iOS 10 Device

    Security Settings You Should Have on Your iOS 10 Device

    The security setting you either need to turn off or on are only a few taps away. You won't have to go through a sea of settings jut to get to it. Let's get to it and secure your iOS 10 device!

    Read more...

  • How You Can Keep Your WiFi Safe

    How You Can Keep Your WiFi Safe

    Even if having to deal with WiFi security is a real pain for some, it is something that needs to attention. Someone could steal your WiFi and use it for who knows what and cross your fingers that it is not for anything illegal.

    Read more...

  • What You Should Keep in Mind Before Buying a Used Smartphone

    What You Should Keep in Mind Before Buying a Used Smartphone

    As long as the phone works fine and has what you need, who care if it's not this years model. So, you've decided that the best thing you can do is buy a used phone. Before you go phone shopping, there are some things you need to keep in mind before you buy.

    Read more...

  • The Most Effective Ways to Get More Followers on Instagram

    The Most Effective Ways to Get More Followers on Instagram

    Before you give up and think about closing your Instagram account, there are some tips and tricks on how to increase your Instagram followers you should know about. By following these tips,...

    Read more...

  • How to Make a GIF From a Video (Windows, Mac, iOS, Android)

    How to Make a GIF From a Video (Windows, Mac, iOS, Android)

    ver the certain period of time, GIF images have gained so much popularity, and you can see them on the Social Networking websites. In the comments section of a website or your Twitter timeline, GIF is actually an animated image format which is created from different images or videos.

    Read more...

  • How to Take Great Pictures with Your Android Device

    How to Take Great Pictures with Your Android Device

    When was the last time you used a digital camera to take a picture? It's probably been a while, right? Most of us used our smartphone to take a million pictures of our pets or of that beautiful sunset you were lucky enough to see.

    Read more...

  • The Best iPhone 7 Tips and Tricks You're Probably Not Using

    The Best iPhone 7 Tips and Tricks You're Probably Not Using

    iOS offers an endless amount of great features you can enjoy, but you may not be taking advantage of them because you might not even know they exist or are too afraid you'll mess something up by tampering with it.

    Read more...

How to Use Terminal as an FTP Client on Your Mac

How to Use Terminal as an FTP Client on Your Mac

7.0/7 rating 1 vote

The Terminal on your Mac can do a lot more than what you think it can. It allows you to get a lot of tasks done on your Mac using simple commands like it lets you reveal the path of a file on your Mac.

If you don't already know, Terminal can also act as an FTP client for you. With its ability to help you connect and work with an FTP server, you can download and upload files to your server, create and delete directories, and so on, all from within the Terminal window.

Here's how you can go about using the FTP ability of the Terminal app on a Mac:

Note: The following command will work on a Linux terminal as well.

Using Terminal as an FTP Client on a Mac

Keep your FTP server login details ready as you're going to need them in the following steps to connect to the server.

Connecting and Logging Into the FTP Server

The first thing you need to do is connect to your FTP server and then log-in using your FTP account. It can be done using the following command in Terminal:

ftp ip-address

FTP Client on Your Mac

Replace ip-address with the IP address of the FTP server you want to connect to.

Once it's connected to the specified FTP server, it will ask you to input your username. Do so and press Enter.

FTP Client on Your Mac

You will then be asked to enter your password. Do so and press Enter.

FTP Client on Your Mac

You should then see yourself connected to the server and all set to interact with the server.

FTP Client on Your Mac

Downloading and Uploading Files to the FTP Server

In order to upload a new file to the server, you need to use the following command in Terminal:

put path-to-file.ext remote-file-name.ext

In the above command:

  • put is used to put the file onto the remote server.
  • path-to-file - this is the local path to the file on your Mac
  • remote-file-name.ext - this is the name that should be used for the file on the remote server along with the file extension

So, if I want to upload a file called MyFile.pdf from my Mac's desktop over to the FTP server with the name MyNewFile.pdf, then I will use the following command:

put /Users/Mahesh/Desktop/MyFile.pdf MyNewFile.pdf

FTP Client on Your Mac

Your file will then be uploaded to the server.

Now, to download a file from the server, you can use the following command:

get path-to-remote-file.ext local-file.ext

where:

  • get - the command used to retrieve a file from the remote server.
  • path-to-remote-file.ext - this is the path to the file on the remote server.
  • local-file.ext - this is the file name that will be downloaded on your Mac.

The following command should retrieve MyNewFile.pdf from the remote server over to the desktop on my Mac with the name Downloaded.pdf.

get MyNewFile.pdf /Users/Mahesh/Desktop/Downloaded.pdf

FTP Client on Your Mac

Create a New Directory on the FTP Server

You can also create a new directory (folder) on the FTP server with Terminal's FTP feature.

To create a directory called omghowto on the FTP server, you would use the following command:

mkdir omghowto

FTP Client on Your Mac

Changing Names of the Files

You can rename files on the FTP server by using the following command in Terminal:

rename old-name.ext new-name.ext

FTP Client on Your Mac

where old-name.ext is the current name of the file and new-name.ext is the new name that you would like to give to the file.

Moving Files on the FTP Server

If you would like to move a file to another directory, then you can use the following command to do that:

rename file-name.ext destination-path/file-name.ext

FTP Client on Your Mac

Besides the destination directory, you also need to specify the name of the file that should be saved there.

Deleting Files on the FTP Server

If you want to delete a file that is located on the server, then the following command should help you do that:

delete MyFile.pdf

FTP Client on Your Mac

It will delete a file called MyFile.pdf on the FTP server.

Seeing the Last Modified Date of a File

If you wish to see when a file was last modified, then you can use the following command to do that:

ls -l MyFile.txt

FTP Client on Your Mac

You should see the date and time when the file was last modified. Also, it should let you see the permissions that the file has.

Changing File Permissions

If you would like to change the permissions that a file has, then you can use the following command:

chmod 777 MyFile.pdf

FTP Client on Your Mac

Where chmod is the command, 777 is the file permission value, and MyFile.pdf is the name of the file on the server.

Creating a New File on the Server

Not only can you upload or download files from the server, but you can also create a new file on the server using the following command:

!touch MyFile.txt
put MyFile.txt MyFile.txt

FTP Client on Your Mac

The first command creates a new file and the second command places the file on the server.

Getting Help with the Commands

If you would like to know what all the commands are that you can use with Terminal to do your FTP tasks, then you can run the following command and it will list out all the available Terminal FTP commands on your screen:

help

FTP Client on Your Mac

You should see that there are a number of commands that you can use.

Now that you know that even the Terminal on your Mac can be used as an FTP client, you won't run to a third-party app for transferring files to and fro your FTP server.

Let us know if this helped you!

Read more like this


Latest

  • Security Settings You Should Have on Your iOS 10 Device
    Security Settings You Should Have on Your iOS 10 Device
  • How You Can Keep Your WiFi Safe
    How You Can Keep Your WiFi Safe
  • How to Hide Pictures, App Icons and Files on Android
    How to Hide Pictures, App Icons and Files on Android
  • What You Should Keep in Mind Before Buying a Used Smartphone
    What You Should Keep in Mind Before Buying a Used Smartphone
  • 10 Best Backpacks for College Students
    10 Best Backpacks for College Students
  • Top 5+ Best Point and Shoot Digital Camera
    Top 5+ Best Point and Shoot Digital Camera

Author

Mahesh Makvana
Mahesh Makvana

Mahesh is a tech enthusiast who loves writing about technology. Mostly, he prefers writing How To posts that help users get the most out of their tech gadgets. While he is not writing a post, he's usually thinking of the next set of posts he could create. You can follow him on Twitter at @maheshhari.

comment

Leave a comment

You are commenting as guest.

Recent Comment

doesn't work -- using 10.12.1

bc tried several times including cd'ing to /

bernard 03. December, 2016 |

Great article

I run Directory Report as an administrator
That way it can find hidden file
http://www.file-utilities.com

It can...

Allan Man 23. November, 2016 |

This article is best google chorme are install.This extensions are help different email autuomatically introduce to user. This is must...

Tilly Wilson 10. November, 2016 |

About Website

OMG!HOWTO is a technology website where we cover the latest from Apple, Facebook, Microsoft and Tips & Tricks. We seek to present fresh news, useful tips, tutorials, applications that the modern technology user will appreciate. OMGHOWTO.COM is powered by Joomla.

0
Shares
0
Shares