linux源码在哪能下到,linux的shell命令源码在哪能找到?比如find的源码

该博客详细记录了在Linux环境中,通过rpm命令查找findutils源码包,然后在rpmfind.net下载,接着上传、解压并查看源码的过程。作者展示了如何使用rpm2cpio和tar命令提取源码,并进入源码目录查看文件结构,最后进入到find子目录并列出其内容,展示了一个完整的源码分析步骤。
摘要由CSDN通过智能技术生成

一、rpm -qif `which find` | grep "Source RPM" | awk '{print $NF}'

[root@saltstack ~]# rpm -qif `which find` | grep "Source RPM" | awk '{print $NF}'

findutils-4.5.11-5.el7.src.rpm

二、去rpmfind.net搜索关键字findutils

d418b4cf8a32065b9dadb6a04368caec.png

5e48a1017f01fb7fada0e556e1a56932.png

三、下载findutils-4.5.11-6.el7.src.rpm

f7b0fa89657704f963eb54d717c0ff9b.png

58f9261dc7e5cef30ff0ac82be644992.png

四、上传、查看源码包

[root@ceph-1 shell]# rz -y

[root@ceph-1 shell]# ls

findutils-4.5.11-6.el7.src.rpm

[root@ceph-1 shell]# rpm2cpio findutils-4.5.11-6.el7.src.rpm| cpio -idv

findutils-4.4.0-no-locate.patch

findutils-4.4.2-autofs.patch

findutils-4.4.2-xautofs.patch

findutils-4.5.11-bz1116237.patch

findutils-4.5.11-fd-leak.patch

findutils-4.5.11-ppc-gnulib-tests.patch

findutils-4.5.11.tar.gz

findutils-4.5.7-warnings.patch

findutils.spec

6181 blocks

[root@ceph-1 shell]# ls

findutils-4.4.0-no-locate.patch findutils-4.5.11-6.el7.src.rpm findutils-4.5.11-ppc-gnulib-tests.patch findutils.spec

findutils-4.4.2-autofs.patch findutils-4.5.11-bz1116237.patch findutils-4.5.11.tar.gz

findutils-4.4.2-xautofs.patch findutils-4.5.11-fd-leak.patch findutils-4.5.7-warnings.patch

[root@ceph-1 shell]# tar xf findutils-4.5.11.tar.gz

[root@ceph-1 shell]# ls

findutils-4.5.11 findutils-4.5.11-ppc-gnulib-tests.patch

findutils-4.4.0-no-locate.patch findutils-4.5.11-6.el7.src.rpm findutils-4.5.11.tar.gz

findutils-4.4.2-autofs.patch findutils-4.5.11-bz1116237.patch findutils-4.5.7-warnings.patch

findutils-4.4.2-xautofs.patch findutils-4.5.11-fd-leak.patch findutils.spec

[root@ceph-1 shell]# cd findutils-4.5.11/

[root@ceph-1 findutils-4.5.11]# ll

total 2264

-rw-r--r-- 1 root root 93787 Nov 18 2012 ABOUT-NLS

-rw-r--r-- 1 root root 44337 Feb 2 2013 aclocal.m4

-rw-r--r-- 1 root root 1331 Nov 17 2012 AUTHORS

drwxr-xr-x 3 root root 4096 Feb 2 2013 build-aux

-rw-r--r-- 1 root root 411052 Feb 2 2013 ChangeLog

-rw-r--r-- 1 root root 91938 Feb 2 2013 config.h.in

-rwxr-xr-x 1 root root 1294667 Feb 2 2013 configure

-rw-r--r-- 1 root root 8331 Feb 2 2013 configure.ac

-rw-r--r-- 1 root root 35068 Aug 21 2011 COPYING

drwxr-xr-x 2 root root 4096 Feb 2 2013 doc

drwxr-xr-x 3 root root 328 Feb 2 2013 find

drwxr-xr-x 4 root root 65 Feb 2 2013 gl

-rw-r--r-- 1 root root 4573 Dec 15 2012 GNUmakefile

-rw-r--r-- 1 root root 2376 Feb 2 2013 import-gnulib.config

-rwxr-xr-x 1 root root 11410 Nov 17 2012 import-gnulib.sh

-rw-r--r-- 1 root root 15578 Nov 18 2012 INSTALL

drwxr-xr-x 2 root root 4096 Feb 2 2013 lib

drwxr-xr-x 3 root root 252 Feb 2 2013 locate

drwxr-xr-x 2 root root 185 Feb 2 2013 m4

-rw-r--r-- 1 root root 62820 Dec 15 2012 maint.mk

-rw-r--r-- 1 root root 2142 Nov 17 2012 Makefile.am

-rw-r--r-- 1 root root 70020 Feb 2 2013 Makefile.in

-rw-r--r-- 1 root root 68339 Feb 2 2013 NEWS

drwxr-xr-x 2 root root 4096 Feb 2 2013 po

-rw-r--r-- 1 root root 3177 Nov 17 2012 README

-rw-r--r-- 1 root root 1049 Nov 17 2012 README-alpha

-rw-r--r-- 1 root root 7541 Nov 17 2012 README-hacking

-rw-r--r-- 1 root root 10 Aug 21 2011 stamp-h.in

drwxr-xr-x 4 root root 12288 Feb 2 2013 tests

-rw-r--r-- 1 root root 1418 Nov 13 2012 THANKS

-rw-r--r-- 1 root root 3084 Nov 17 2012 TODO

-rw-r--r-- 1 root root 1968 Feb 2 2013 tool-versions.txt

drwxr-xr-x 3 root root 91 Feb 2 2013 xargs

[root@ceph-1 findutils-4.5.11]# cd find/

[root@ceph-1 find]# ll

total 524

-rw-r--r-- 1 root root 19855 Feb 2 2013 defs.h

-rw-r--r-- 1 root root 9645 Feb 2 2013 exec.c

-rw-r--r-- 1 root root 62856 Nov 17 2012 find.1

-rw-r--r-- 1 root root 43590 Feb 2 2013 find.c

-rw-r--r-- 1 root root 1094 Nov 17 2012 finddata.c

-rw-r--r-- 1 root root 7489 Nov 17 2012 fstype.c

-rw-r--r-- 1 root root 873 Nov 17 2012 ftsfind.1

-rw-r--r-- 1 root root 19264 Feb 2 2013 ftsfind.c

-rw-r--r-- 1 root root 2440 Nov 17 2012 Makefile.am

-rw-r--r-- 1 root root 75571 Feb 2 2013 Makefile.in

-rw-r--r-- 1 root root 877 Nov 17 2012 oldfind.1

-rw-r--r-- 1 root root 99771 Nov 17 2012 parser.c

-rw-r--r-- 1 root root 35248 Nov 17 2012 pred.c

-rw-r--r-- 1 root root 34672 Feb 2 2013 print.c

-rw-r--r-- 1 root root 387 Nov 17 2012 print.h

-rw-r--r-- 1 root root 4278 Nov 17 2012 sharefile.c

-rw-r--r-- 1 root root 1048 Nov 17 2012 sharefile.h

drwxr-xr-x 5 root root 264 Feb 2 2013 testsuite

-rw-r--r-- 1 root root 46874 Nov 17 2012 tree.c

-rw-r--r-- 1 root root 27761 Feb 2 2013 util.c

[root@ceph-1 find]# vim find.c

标签:shell,Feb,--,源码,rw,linux,root,2013,findutils

来源: https://www.cnblogs.com/luoahong/p/11934209.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值