2

In this particular case the reset command. I want to read the code of this command.

TY

userDepth
  • 2,040

1 Answers1

7

For commands that are actually present on the system, the query mode of dpkg is often helpful: either dpkg -S or (equivalently) dpkg-query -S e.g.

$ dpkg-query -S $(which reset)
ncurses-bin: /usr/bin/reset

For querying the contents of packages that are not already installed, there is the apt-file utility (not installed by default, but available from the Universe repository)

$ apt-file search -x '/reset$'
crossfire-common: /usr/share/games/crossfire/wizhelp/reset
hybserv: /usr/share/hybserv/help/chanserv/level/reset
ncurses-bin: /usr/bin/reset
ns2-examples: /usr/share/doc/ns2/examples/tcl/test/test-output-tcpReset/reset

Alternatively, you can search at http://packages.ubuntu.com/ either by package name or contents.


To actually obtain the package's source code once you have identified it, see How do I get and modify the source code of packages installed through apt-get?

steeldriver
  • 142,475