AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / unix / 问题 / 481744
Accepted
AbstProcDo
AbstProcDo
Asked: 2018-11-15 07:46:30 +0800 CST2018-11-15 07:46:30 +0800 CST 2018-11-15 07:46:30 +0800 CST

大小命令无法识别,认为安装正确

  • 772

我正在研究 macOS 并在 cc 上尝试了 size 命令

$ which cc
/usr/bin/cc

它不能正常工作

$ size /usr/bin/cc
size: /usr/bin/cc: unknown load command 0x32
size: /usr/bin/cc: unknown load command 0x32
size: /usr/bin/cc: unknown load command 0x32
size: /usr/bin/cc: file format not recognized

$ size /bin/ls
size: /bin/ls: unknown load command 0x32
size: /bin/ls: unknown load command 0x32
size: /bin/ls: unknown load command 0x32
size: /bin/ls: file format not recognized

并且尺寸是最新版本

$ size --version
GNU size (GNU Binutils) 2.31.1
Copyright (C) 2018 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.

但是在 Centos 上

[root@iz2ze9wve43n2nyuvmsfx5z ~]# size /usr/bin/cc
   text    data     bss     dec     hex filename
 754853    8488   81856  845197   ce58d /usr/bin/cc

命令大小有什么问题?

$ file /usr/bin/cc
/usr/bin/cc: Mach-O 64-bit executable x86_64


$ size --help
Usage: size [option(s)] [file(s)]
 Displays the sizes of sections inside binary files
 If no input file(s) are specified, a.out is assumed
 The options are:
  -A|-B     --format={sysv|berkeley}  Select output style (default is berkeley)
  -o|-d|-x  --radix={8|10|16}         Display numbers in octal, decimal or hex
  -t        --totals                  Display the total sizes (Berkeley only)
            --common                  Display total size for *COM* syms
            --target=<bfdname>        Set the binary file format
            @<file>                   Read options from <file>
  -h        --help                    Display this information
  -v        --version                 Display the program's version

这行得通

me at Max-2018 in ~/desktop
$ /Library/Developer/CommandLineTools/usr/bin/size /usr/bin/cc
__TEXT  __DATA  __OBJC  others  dec hex
4096    4096    0   4294979584  4294987776  100005000   


$ ls /Library/Developer/CommandLineTools/usr/bin | grep size
llvm-size
size
size-classic
command-line osx
  • 1 1 个回答
  • 632 Views

1 个回答

  • Voted
  1. Best Answer
    JRFerguson
    2018-11-17T05:55:04+08:002018-11-17T05:55:04+08:00

    size尽管按照您的说明安装了命令行工具包,但您似乎已经安装了 GNU 。试试:/Library/Developer/CommandLineTools/usr/bin/size。

    如果您的操作系统是 El Capitan (10.11) 或更高版本,您必须禁用SIP(​​至少暂时)才能安装到 /bin、/sbin 和 /usr 等目录(但不是 /usr/local)。

    • 1

相关问题

  • csplit 无法识别提供的正则表达式

  • 需要许多参数的实用程序的推荐界面是什么?[关闭]

  • 远程运行 X 应用程序,在远程主机上运行 GUI [关闭]

  • 使 mysql CLI 以交互方式向我询问密码

  • 没有服务器的命令行 pub/sub?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    ssh 无法协商:“找不到匹配的密码”,正在拒绝 cbc

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    如何卸载内核模块“nvidia-drm”?

    • 13 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Wong Jia Hau ssh-add 返回:“连接代理时出错:没有这样的文件或目录” 2018-08-24 23:28:13 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST
  • Martin Hope
    Bagas Sanjaya 为什么 Linux 使用 LF 作为换行符? 2017-12-20 05:48:21 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve