Re: source code of shell commands



Ronald <followait@xxxxxxx> writes:

George Huber wrote:
Ronald wrote:
I would like to study some classic implementation of shell command
like cp mv ...
Where can find the source code?
If you are running a rpm based system, you can use rpm to find out
what
package provides an executable.
For example, the command "rpm -qf /bin/ls" will give the following
result, coreutils-5.2.1-31
This means that the command 'ls' is provided by the rpm package
'coreutils'. A simple search of the web should be able to yield a
source RPM for this package.
Geoge

No, I don't use rpms. I'm using ubuntu now.

Then you can use dpkg and apt-get. You an find out which package
provides one of these commands with, for instance

snowball:533$ which cp
/bin/cp
snowball:534$ dpkg -S /bin/cp
coreutils: /bin/cp

Now you can get the source with

snowball:535$ apt-get source coreutils
--
Joseph J. Pfeiffer, Jr., Ph.D. Phone -- (505) 646-1605
Department of Computer Science FAX -- (505) 646-1002
New Mexico State University http://www.cs.nmsu.edu/~pfeiffer
.



Relevant Pages

  • [PATCH 1/2] kbuil: add deb-pkg target
    ... # To prepare kbuild for more kernel packaging formats move all packaging ... # In top-level Makefile introduce generic support for all package ... Included the old rpm target for backward ... # and builddeb scripts. ...
    (Linux-Kernel)
  • Re: Conventions for NFS sharing of binaries
    ... Do you have distro & local packages with same name? ... mount it r/w on your "master installation machine" (with RPM management). ... If you replace a package with a different one with the same name, hmm, you ...
    (comp.os.linux.misc)
  • Re: ./configure command
    ... The package is not available. ... machines which don't even have an OS at all, let alone RPM, ... There is not a "the tool to package and install on Fedora". ... If he wants to avoid trouble, ...
    (Fedora)
  • Re: Backing up whole system
    ... Amanda is packaged by Fedora and if Gene feels that the packages are ... fedora's rpm is/was incapable of handling the nuances of using only enough ... When an rpm package can build a complete user from scratch, ... Do you really believe that rpm can install every package under the sun, ...
    (Fedora)
  • Re: Redhat to Freebsd
    ... >>researching security updates or in performing kernel or package updates. ... >>I assume it is only the Redhat distro that has the ease of RPM installation? ... So you can build from sources with ports, or install binaries ...
    (comp.unix.bsd.freebsd.misc)