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

一、rpm -qif which find | grep “Source RPM” | awk ‘{print $NF}’

;gutter:true;
[root@saltstack ~]# rpm -qif
which find | grep "Source RPM" | awk '{print $NF}' findutils-4.5.11-5.el7.src.rpm</p> <pre><code> ## 二、去rpmfind.net搜索关键字findutils ![linux的shell命令源码在哪能找到?比如find的源码](https://johngo-pic.oss-cn-beijing.aliyuncs.com/articles/20220811/1075436-20191126100425390-1075620090.png) ![linux的shell命令源码在哪能找到?比如find的源码](https://johngo-pic.oss-cn-beijing.aliyuncs.com/articles/20220811/1075436-20191126100511540-1856474082.png) ## 三、下载findutils-4.5.11-6.el7.src.rpm ![linux的shell命令源码在哪能找到?比如find的源码](https://johngo-pic.oss-cn-beijing.aliyuncs.com/articles/20220811/1075436-20191126101257895-1479927395.png) ![linux的shell命令源码在哪能找到?比如find的源码](https://johngo-pic.oss-cn-beijing.aliyuncs.com/articles/20220811/1075436-20191126101338380-141866058.png) ## 四、上传、查看源码包 ;gutter:true;
[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

Original: https://www.cnblogs.com/luoahong/p/11934209.html
Author: 活的潇洒80
Title: linux的shell命令源码在哪能找到?比如find的源码

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/8775/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

发表回复

登录后才能评论
免费咨询
免费咨询
扫码关注
扫码关注
联系站长

站长Johngo!

大数据和算法重度研究者!

持续产出大数据、算法、LeetCode干货,以及业界好资源!

2022012703491714

微信来撩,免费咨询:xiaozhu_tec

分享本页
返回顶部