Linux command
size 命令
文件
复制后可按需替换文件名、目录或参数。
常用示例
Example
size [path/to/file]
Example
size -o [path/to/file]
Example
size -d [path/to/file]
Example
size -x [path/to/file]
Example
size -t [path/to/file1] [path/to/file2]
Example
size -A [path/to/file]
说明
size lists the section sizes and total size of binary object files. For each object file, it displays the sizes of the text (code), data, and bss (uninitialized data) sections, along with the total size in bytes and hexadecimal. The default Berkeley format shows a concise one-line output per file. System V format provides a detailed listing of all sections. If no files are specified, a.out is examined by default.
参数
- -A, --format=sysv
- Use System V output format (detailed section listing)
- -B, --format=berkeley
- Use Berkeley output format (default: text, data, bss, total)
- -G, --format=gnu
- Use GNU output format
- -d, --radix=10
- Display sizes in decimal
- -o, --radix=8
- Display sizes in octal
- -x, --radix=16
- Display sizes in hexadecimal
- -t, --totals
- Show aggregate totals for all listed object files
- --common
- Include common symbols in the bss size
- --target _bfdname_
- Specify object code format for the file
- -V, --version
- Display version information
- -h, --help
- Display help information
FAQ
What is the size command used for?
size lists the section sizes and total size of binary object files. For each object file, it displays the sizes of the text (code), data, and bss (uninitialized data) sections, along with the total size in bytes and hexadecimal. The default Berkeley format shows a concise one-line output per file. System V format provides a detailed listing of all sections. If no files are specified, a.out is examined by default.
How do I run a basic size example?
Run `size [path/to/file]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -A, --format=sysv do in size?
Use System V output format (detailed section listing)