linux下ls命令等源码查看【源自coreutils软件包】

注:以下测试在ubuntu 9.10上进行,其他平台未测试

一、命令说明

ls等命令不是系统内核固有的,这些命令都是通过coreutils软件包来实现的,当然是在调用shell函数的基础上啦。

二、官方介绍

来自:http://www.gnu.org/software/coreutils/

Coreutils - GNU core utilities

Introduction to Coreutils

The GNU Core Utilities are the basic file, shell and text manipulation utilities of the GNU operating system.
These are the core utilities which are expected to exist on every operating system.

简单来说就是一个软件工具包,里面有各种命令:如ls,mv,cat,touch,mkdir等等的源码实现,这个包依赖系统的shell

三、源码下载

1、通过网页等下载

ftp://alpha.gnu.org/gnu/coreutils/

https://ftp.gnu.org/gnu/coreutils/

2、命令行方式:

sudo apt-get source coreutils

示例如下

 

四、查看源码

我目前的水平还看不懂源码,无法分析比如: ls -a -l命令是如何解析的,等时机成熟了估计就会了

 

2020-02-14@北京,下周一开工,SARS-CoV-2 后希望开工顺利,在家里都待傻(⊙_⊙)?了


版权声明:本文为tsummer2010原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。