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... Thanks in advance |
Hi,
hm ist strace what you want? Code:
strace -f ls -l |
Quote:
The directory in which ls is stored is commonly in your default path in almost every Linux distro. The command Code:
whereis ls You can learn more about path statements here: http://www.cyberciti.biz/faq/howto-print-path-variable/ Path statements are also used in Windows. Hope this helps a bit. |
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..? Please help me... Thanks in advance |
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) |
I tend to use the find command.
Many commands have help in one way or the other. The man command is a manual (book) so you type man find and get simple help for that command in shell. find --h sometimes works too. |
Thanks
Thanks for your reply...
|
All times are GMT -5. The time now is 06:46 AM. |