LinuxCommandLibrary

nm

lists symbols from object files

TLDR

List symbols
$ nm [binary]
copy
Show only external symbols
$ nm -g [binary]
copy
Show undefined symbols
$ nm -u [binary]
copy
Show defined symbols
$ nm -U [binary]
copy
Demangle C++ symbols
$ nm -C [binary]
copy
Sort by address
$ nm -n [binary]
copy
Show symbol sizes
$ nm -S [binary]
copy

SYNOPSIS

nm [options] files

DESCRIPTION

nm lists symbols from object files. Shows function and variable names.
The tool inspects binaries. Essential for debugging and reverse engineering.

PARAMETERS

FILES

Object files or libraries.
-g
External symbols only.
-u
Undefined symbols only.
-U
Defined symbols only.
-C
Demangle C++ names.
-n
Sort by address.
-S
Print symbol sizes.
--help
Display help information.

CAVEATS

Requires debug symbols for best results. Part of binutils. Platform variations.

HISTORY

nm is a classic Unix utility from early Unix systems for examining object file symbols.

SEE ALSO

objdump(1), readelf(1), strings(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard