Is it possible to see the actual code of the linux command?
Linux - KernelThis forum is for all discussion relating to the Linux kernel.
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.
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.
Is it possible to see the actual code of the linux command?
Hi All,
I would like to see the actual code which is executed when we give the command to the shell.
e.g. $ls -l
where the ls stored?
how shell know to execute the code of ls file when it gets the ls command in the shell prompt? is there any data structure managed by LINUX/UNIX for the command and respective executable file mapping?
Please help me to understand this basic concepts...
Is there any mapping table which helps to the shell
Thanks for your reply....
I am still confused with the second concept..i.e.
Is there any data structure like maps the command to the particular file..
How shell understand which file is to be executed when it gets the command..?
When you enter a command, the shell looks in the PATH global variable to find where to look. You can always bypass this behavior by specifying the full path.
The PATH variable is set in your startup scripts and can be viewed using "echo $PATH".
As far as seeing the "actual code", you can get the source code from the package maintainer. (start with Sourceforge)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.