LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-30-2004, 10:20 AM   #1
jdruin
Member
 
Registered: Jul 2003
Location: Louisville aka Derby City
Distribution: WinXP SP2 and SP3, W2K Server, Ubuntu
Posts: 313

Rep: Reputation: 30
Where is source code in general?


I am learning Linux and as a programmer myself, I find it easier to look at code in many cases rather than read and article on how something works. Today I was trying to find the source code for the 'clear' bash command. I found the compiled ELF file in /usr/bin but I could not find the corresponding clear.c or whatever the file would be called.

Could someone explain where source code is general kept? Thanks for a complete answer.
 
Old 10-30-2004, 10:23 AM   #2
Komakino
Senior Member
 
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 55
I'm not sure...but if it comes as part of bash perhaps you could download the source code for bash from the gnu website and inspect that?
 
Old 10-30-2004, 10:40 AM   #3
jdruin
Member
 
Registered: Jul 2003
Location: Louisville aka Derby City
Distribution: WinXP SP2 and SP3, W2K Server, Ubuntu
Posts: 313

Original Poster
Rep: Reputation: 30
Bash just runs the command by calling the binary in /usr/bin. I need the uncompiled source code.
 
Old 10-30-2004, 02:15 PM   #4
eelriver
Member
 
Registered: May 2004
Location: san francisco
Distribution: Slackware 10.2 kernel 2.6.13, Gentoo amd64, Some mish-mash of programs that started with slack 9.0
Posts: 165

Rep: Reputation: 30
It's the distributions to responsibility to provide source code for programs licensed under the GPL. Often, source code is not included on the CDs themselves, but there should be some sort of clue as to where you can get it. Try the Xandros web page. Or, as has already been suggested, the Gnu site.
 
Old 10-30-2004, 03:31 PM   #5
friendly_guy
Member
 
Registered: Oct 2003
Location: England
Distribution: Lubuntu, Bodhi, Puppy,
Posts: 85

Rep: Reputation: 15
I do not know if there is one consistent place to find all source code. If you get the full set of discs for most distro's it includes all the source code. If you go to the slackware site you can get all its source there too if you search the mirrors.eg at:

ftp://ftp.mirrorservice.org/sites/ft...e-10.0/source/

and the code for bash at

ftp://ftp.mirrorservice.org/sites/ft...source/a/bash/

You will need to download & extract the archive.

*everything* you want should be there. I am sorry I am not enough of a programmer to tell you where to find the bit you want is in all that, but I hope this helps. Perhaps search the extracted folder for a keyword?

I wish you success - what you are trying to do is the whole point of open source.
 
Old 11-01-2004, 01:31 PM   #6
jdruin
Member
 
Registered: Jul 2003
Location: Louisville aka Derby City
Distribution: WinXP SP2 and SP3, W2K Server, Ubuntu
Posts: 313

Original Poster
Rep: Reputation: 30
I found it on the Xandros ftp server site at ftp://ftp2.xandros.com/src/pool/xandros2.5-src/main/

This appears to be a Xandros specific source but just looking at it I cannot see any topical differences from Debian source.

Thanks all for the pointers.
 
Old 11-04-2004, 03:15 PM   #7
jdruin
Member
 
Registered: Jul 2003
Location: Louisville aka Derby City
Distribution: WinXP SP2 and SP3, W2K Server, Ubuntu
Posts: 313

Original Poster
Rep: Reputation: 30
I wasnt 100% confortable with the answers on what the numbers mean in man page names. I found the answer on the linux doc project website. www.tldp.org

Also, I found where the source code is generally kept.

Man page numbers are descripitons of there content according to the follow heirarchy

man1: User programs
Manual pages that describe publicly accessible commands are contained
in this chapter. Most program documentation that a user will need to
use is located here.

man2: System calls
This section describes all of the system calls (requests for the kernel
to perform operations).

man3: Library functions and subroutines
Section 3 describes program library routines that are not direct calls
to kernel services. This and chapter 2 are only really of interest to
programmers.

man4: Special files
Section 4 describes the special files, related driver functions, and
networking support available in the system. Typically, this includes
the device files found in /dev and the kernel interface to networking
protocol support.

man5: File formats
The formats for many data files are documented in the section 5. This
includes various include files, program output files, and system files.

man6: Games
This chapter documents games, demos, and generally trivial programs.
Different people have various notions about how essential this is.

man7: Miscellaneous Manual pages that are difficult to classify are
designated as being section 7. The troff and other text processing
macro packages are found here.

man8: System administration Programs used by system administrators
for system operation and maintenance are documented here. Some of
these programs are also occasionally useful for normal users.

The source doe is generally kept in

/usr/src
The 'linux' sub-directory holds the Linux kernel sources, header-files and documentation.
 
Old 11-04-2004, 05:24 PM   #8
Komakino
Senior Member
 
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 55
Clear could be part of the termutils programs which are available on the gnu.org website. Try there.

Last edited by Komakino; 11-04-2004 at 05:25 PM.
 
Old 11-05-2004, 12:00 AM   #9
Fascistchicken
Member
 
Registered: Jul 2003
Location: hellifniknow
Distribution: slackware for chickens
Posts: 182

Rep: Reputation: 30
you could try to download from the slackware distribution servers, even if you dont use slackware itself,
under the source directory, youll find it uses only source code that is unmodified, so its identical to the original
 
Old 11-05-2004, 12:48 AM   #10
95se
Member
 
Registered: Apr 2002
Location: Windsor, ON, CA
Distribution: Ubuntu
Posts: 740

Rep: Reputation: 32
clear is actually part of Ncurses. Check out http://www.linuxfromscratch.org/lfs/news.html you can find where to get the source code for all those programs.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to convert Assembly code to "C" source code ssg14j Programming 2 08-01-2005 01:48 PM
compiling distro from source? general questions kahn Red Hat 3 07-31-2005 03:32 PM
General source versus scripting question R00ts Programming 9 06-29-2005 05:04 PM
General Source RPM question edward321 Red Hat 1 06-03-2005 11:11 AM
Source Code ntalektual Linux - Newbie 5 08-09-2003 02:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration