I wanted to see in real time when files are created and deleted in a directory under linux shell.

This is the easiest way:

inotifywait /path/to/directory --recursive --monitor --event CREATE --event DELETE

Installation:

sudo apt-get install inotify-tools

Source:
https://askubuntu.com/questions/541128/monitor-folder-contents-changes