There are several implementations of these, the most popular ones being the GNU coreutils (found in most Linux distributions) and the BSD implementation (found in FreeBSD, OS X, and other mostly non-linux Unix-likes).
Unless you are on a distro that installs everything from source (like Gentoo), you will have to ask your package manager to download the sources for you. On Debian-based systems, the appropriate command is apt-get source {package-name}
, which downloads the source for the specified package and stores it in the current directory. All that's left is find out which package those commands are in; you can either dig through your package manager's documentation to find out how, or you can search your distro's website - most of them have a package search that allows you to search for individual files within packages.
For Debian-based systems (such as Ubuntu):
$ dpkg -S /bin/rm
coreutils: /bin/rm
$ dpkg -l coreutils
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Description
+++-============================-============================-========================================================================
ii coreutils 8.13-3ubuntu3 GNU core utilities
For Red Hat-based systems (such as Fedora and Centos):
$ rpm -qf /bin/rm
coreutils-5.97-34.el5_8.1