How to do SFTP using pem file from command line?

Simple file transfer protocol ( SFTP ) is really essential in many cases. The regular SFTP is very straightforward. But when we want to do SFTP using a identity file (.pem) then the command is bit different.

We will have use ssh_option (-o) with the IdentityFile like below:

$ sftp -o IdentityFile=demo.pem