Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
12-17-2006, 07:34 AM
|
#1
|
|
LQ Newbie
Registered: Dec 2006
Posts: 1
Rep:
|
viewing the source code
how can i view the source code for the general commands of the shell
for example ls, echo, cat etc
similarly how can i view the source code for standard c functions for example pow, strcpy, strlen.
|
|
|
|
12-17-2006, 07:42 AM
|
#2
|
|
Member
Registered: Jan 2003
Distribution: Slackware
Posts: 82
Rep:
|
The standard shell commands are mostly in the GNU packages bash and coreutils. The standard C library is a GNU package called GLIBC. You can find source for these on ftp.gnu.org/gnu. Other packages you may be interested in are GNU grep, and procps from procps.sf.net.
|
|
|
|
12-17-2006, 07:45 AM
|
#3
|
|
Member
Registered: Jan 2003
Distribution: Slackware
Posts: 82
Rep:
|
Oh, one other thing. If you use a distro with package management utilities there is a general answer to your problem. You can use look up which package owns a file, then download its source. For example:
For RPM-based (Fedora, Mandrake, SUSE, ...):
rpm -qf /path/to/file
For Debian/Ubuntu:
dpkg --search /path/to/file
|
|
|
|
12-17-2006, 07:49 AM
|
#4
|
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
The commands such as ls and cp are supplied by the coreutils package. Download a source package if you don't have one. The C library is called glibc. You can download the source for that as well. Look at "man <function>" and see which header contains the definition. The source for the function is probably in a directory by the same name, minus the .c.
|
|
|
|
All times are GMT -5. The time now is 05:23 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|