ad-hoc commands is nothing but a command which is used to do something quickly and it is more sort of a one-time use. Unlike, the playbook is used for a repeated actions which is something that is very useful in Ansible environment. But there might be scenarios where we want to use ad-hoc commands which can simply do the required activity and it is a nonrepetitive activity.