In this particular case the reset command. I want to read the code of this command.
TY
In this particular case the reset command. I want to read the code of this command.
TY
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?
apt-file
not installed by default, so you might want to mention that in the answer. 2) OP wants to read source code of the command, so you may want to includeapt-get source
command into your answer. I suggest simplifying withapt-get source $(dpkg-query -S $(which reset) | awk -F ':' '{print $1}')
– Sergiy Kolodyazhnyy Sep 07 '15 at 18:19reset
is a complex one, I think is a script generated on the fly with some Makefile magic, see https://sources.debian.net/src/ncurses/6.0%2B20150810-1/progs/Makefile.in/#L173 ) – Rmano Sep 07 '15 at 21:45