In order block IP address from APF Firewall at command line one need to execute below mentioned commands:
1) Login into the server via shell access.
2) Go to the path of APF firewall. It should be:
3) Edit the file deny_hosts.rules.
4) One can add IP address and save file to block the IP address.