I. INTRODUCTION sometimes I want to see the source code of commands such as ls, cat, and more. This article introduces the corresponding viewing methods. 2. method reference: http://blog.csdn.net/silentpebble/article/details/41279285http://blog.csdn.net/zhenwo123/article/details/19190189
I. INTRODUCTION
Sometimes I want to see the source code of ls, cat, more and other commands. This article introduces the corresponding viewing methods.
II. method
Refer:
http://blog.csdn.net/silentpebble/article/details/41279285http://blog.csdn.net/zhenwo123/article/details/19190189
The following describes how to view the uname command source code:
# whereis unameuname: /bin/uname /usr/share/man/man1/uname.1.gz /usr/share/man/man2/uname.2.gz /usr/share/man
# rpm -qf /bin/uname
coreutils-8.5-7.fc14.i686
# yumdownloader --source coreutils-8.5-7.fc14.i686
# rpm2cpio coreutils-8.5-7.fc14.src.rpm | cpio -idv coreutils-8.5.tar.xz
Coreutils-8.5.tar.xz
9446 blocks
# tar xjvf coreutils-8.5.tar.xz
III. source code analysis
Refer:
http://blog.csdn.net/yxc135/article/details/22161907