how to infer data type in ghidra decompilation result for /usr/bin/ls ?
As I answered on your last question:
open ghidra gui, analyse the binary, click on file -> export program -> and export as a C/C++ file.
In this file, ghidra constructs possible typedefs for you.
typedef unsigned char undefined1;
So, you'll know the possible type of this object. In your particular case, it constructs (assuming a stripped binary):
typedef unsigned long undefined8;
But, note that these types are just estimates and could be different than the original source code (in case of user defined functions).