17

Many of the common utilities in Linux either come packaged in util-linux from Linux Foundation or coreutils from GNU. The man page for top doesn't specify anything.

I am using CentOS.

Peter Mortensen
  • 2,318
  • 5
  • 23
  • 24
euphoria83
  • 810
  • 2
  • 7
  • 11

2 Answers2

16

The "top" utility is in the "procps" package on RHEL/CentOS systems.

ewwhite
  • 197,159
  • 92
  • 443
  • 809
16

You can do yum whatprovides <path> to see what package provides a file. For example, yum whatprovides /usr/bin/top will tell you for top or yum whatprovides '*/top' if you weren't sure of the path.

Eric Renouf
  • 939
  • 8
  • 19
  • How is that going to work if he doesn't have it installed? It's in procps. – Satanicpuppy Apr 17 '15 at 18:19
  • 4
    @Satanicpuppy: Who doesn't have `procps` installed. Anyway, `yum whatprovides '*/top'` also works if you don't know the path, as said. – Sven Apr 17 '15 at 18:21
  • 3
    I'm not sure what having it installed has to do with it, you can still find out what package provides a file with that command, even if the file doesn't exist on your disk. It's how you would lookup what to install to get a file – Eric Renouf Apr 17 '15 at 18:21
  • 3
    The last command need quoting or escaping to work reliably. Could be written as `yum whatprovides "*/top"`, `yum whatprovides '*'/top`, `yum whatprovides \*/top`, or some other variation of it. – kasperd Apr 17 '15 at 22:34
  • 4
    I know this question was tagged [centos] but just for reference: Pacman: `pkgfile /usr/bin/top`; Apt: `apt-file search /usr/bin/top`. –  Apr 18 '15 at 04:36
  • 1
    this is rpm basic usage question "rpm -qf $(which top)" – c4f4t0r Apr 18 '15 at 15:44