Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 11-14-2011, 08:59 AM   #16
Senior Member
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060

Originally Posted by Stephen Morgan View Post
I believe cd is a shell built-in command, rather than a programme with its own source code.
Well, duh! Yup, cd is definitely part of the shell -- of course, one could modify the source to change the behavior of cd but that may be equivalent to those little dancing dogs you see in the circus: the question is not how well but rather why at all, methinks.
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 11-14-2011, 02:31 PM   #17
Registered: Oct 2011
Distribution: Debian 6
Posts: 47

Original Poster
Rep: Reputation: Disabled
Originally Posted by MTK358 View Post
I don't know why anyone marked this as unhelpful, because it's true.

In fact, it's impossible to create a separate program that changes the current directory of the shell, since each process (including the shell and command) has its own separate current directory.
Relax, it's not that unhelpful. I was only asking about reverse engineering the code from the executable (in the case of compiled programs), which I believe that most of the installed programs are.
Old 11-14-2011, 02:51 PM   #18
Senior Member
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
there are two different types of commands
'internal' and 'external' commands
internal commands are part of the shell
external commands are separate binaries that are executed by the shell
a lot of the basic commands that are not internal commands (such as ls) can be found in the 'coreutils' package
Old 11-15-2011, 07:15 PM   #19
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.10, Centos 7.5
Posts: 17,670

Rep: Reputation: 2487Reputation: 2487Reputation: 2487Reputation: 2487Reputation: 2487Reputation: 2487Reputation: 2487Reputation: 2487Reputation: 2487Reputation: 2487Reputation: 2487
The thing to be clear on, is that whether the cmd is part of the shell, or 'external', Linux is FOSS (Free & Open Src SW).
This means that the src code should be available from your normal repos. Most distros don't install the src code by default, because most people don't want/need it.

Note that some distros also give access to non-open SW.
That would involve reverse engineering, which is likely illegal ... depending on jurisdiction/reason for doing so etc.

What Sw do you want to see the src for?
Old 11-15-2011, 07:48 PM   #20
LQ Newbie
Registered: Jan 2010
Location: Beijing,China
Posts: 12

Rep: Reputation: 0
"man alias" you will get what you want.
Old 11-15-2011, 08:17 PM   #21
Registered: Oct 2011
Location: Bolton, UK
Distribution: Arch local, Debian on VPS
Posts: 258

Rep: Reputation: 41
On the off chance that anyone does want to modify a shell built in function, you can get the source for the shell and modify to your hearts content. As has been said many times in this thread, FOSS (Free open source software) is exactly what it says on the tin, open source. If the source hasn't been made readily available, and if you know it's covered by the gnu license, ask the package author for the source (he'll supply it under the terms of the license).

As has also been said, you hit a problem with closed source propriety stuff (which most of GNU/linux isn't) but beyond that the world is your oyster.


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
Edit Command Verbal Kint Linux - Software 2 06-13-2007 11:37 PM
How do I edit files in command line sweb74 Linux - Newbie 13 01-27-2004 10:53 PM
Edit from Command Prompt Paul Mon Linux - General 4 09-22-2003 08:20 PM
how to edit a file when not in X (ie from the command line) ludwig W Linux - Newbie 12 04-22-2003 04:00 AM
what is the command to edit ultravox Linux - General 5 04-06-2003 05:49 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:44 PM.

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