Conor Ginnell Conor Ginnell - 1 month ago 11
Linux Question

Getting the number of symbols in a symbol table

I'm trying to find the number of symbols an executable defines. Let's say our executable is called "node"

I'm running

nm node


on my terminal, and it's outputting a large number of symbols.
I've looked at the man page for nm, along with https://linux.die.net/man/1/nm , but I haven't been able to find something that will simply return a count of the symbols in the symbol table.

Answer

Try the following

nm -an foo | wc -l