Not showing package

In example 2.3,
ros2 pkg list | grep my_package - does not show my_package
I can see it in the directory though.
What may be wrong?

Have you tried sourcing the install/setup.bash of your workspace?

Thanks for the suggestions. I can check that