I have a small cupboard in basement I store paint etc. In house has oil heat but getting a sort of gas smell after bumping the pipe feels loose like it was just back filled with gravel . Old home built in 30s I don't have a gas meter electric appliances.
That looks like a gas line or black iron pipe.
The shutoff valve is typical of gas it may be loose below
I would use caution if you smell gas it could be leaking.
If you have a gas service it could be for a heater that was planned and not used or one that was removed. A soapy water solution dribbled on the threads and valve to check for leaks is a good idea. Gas lines are low pressure and easily sealed.
If you don’t feel comfortable checking it gas companies will usually check for you. They do not want bad things to happen.