linux的程序怎么看代码,如何查看linux命令的源代码

下面以获取cat命令的源代码为例说明:

运行命令:rpm -qif  `which cat`

显示信息如下:

[root@lsy programming]# rpm -qif  `which cat`

Name        : coreutils                    Relocations: (not relocatable)

Version     : 8.4                               Vendor: CentOS

Release     : 19.el6_4.1                    Build Date: Thu 04 Apr 2013 03:59:03 PM CST

Install Date: Mon 15 Apr 2013 11:13:54 PM CST      Build Host: c6b9.bsys.dev.centos.org

Group       : System Environment/Base       Source RPM: coreutils-8.4-19.el6_4.1.src.rpm

Size        : 12634548                         License: GPLv3+

Signature   : RSA/SHA1, Fri 05 Apr 2013 05:02:35 AM CST, Key ID 0946fca2c105b9de

Packager    : CentOS BuildSystem

URL         : http://www.gnu.org/software/coreutils/

Summary     : A set of basic GNU tools commonly used in shell scripts

Description :

These are the GNU core utilities.  This package is the combination of

the old GNU fileutils, sh-utils, and textutils packages.

通过以上信息,可以到网址上取下在.tar.gz的包(http://www.gnu.org/software/coreutils/)

然后解压此包,所有命令的源码都在解压目录下一个叫src的文件夹下。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值