The db2cmd does not exist on Linux. (It's connection-maintenance functionality is done by db2bp).
Your sproc should not contain operating-system-specific code hard-coded inside it - that is bad design.
On Linux shell-level you run the correct db2profile for the relevant db2-instance then simply issuse db2 list db directory.
The db2 Knowledge centre has enough information about db2profile, so study that first.
But the docs won't show you how to design correctly for multiple operating-system platforms - that comes from experience.
Remember that there are some kinds of data processing that is suitable for use inside sprocs, but anything that is operating-system or platform-specific should never be inside sprocs - that is just asking for maintenance and support troubles.