简体   繁体   English

Linux查找命令源代码

[英]Linux Find command source code

When I type find into my terminal, this is the output I get: 当我在终端中键入find时,这是我得到的输出:

My-MacBook-Air:desktop User$ find
usage: find [-H | -L | -P] [-EXdsx] [-f path] path ... [expression]
       find [-H | -L | -P] [-EXdsx] -f path [path ...] [expression]

How does my computer know where the source code for this command is and how can I access it myself? 我的计算机如何知道此命令的源代码在哪里以及如何自己访问它?

Ok well ... first this is probably not Linux but MacOS? 好吧...首先这可能不是Linux,而是MacOS? But no matter what, your computer doesn't use any source code but a compiled executable, that is located somewhere in your search path -- a list of directories that are searched when you enter a command, typically something like /usr/local/bin:/usr/bin:/bin 但是无论如何,您的计算机只使用位于搜索路径中某个位置的已编译可执行文件,而不使用任何源代码-输入命令时搜索的目录列表,通常是/usr/local/bin:/usr/bin:/bin

You can display your search path with echo $PATH and find the full location of find with which find . 您可以显示与搜索路径echo $PATH和发现的完整位置findwhich find

No idea what version of find comes with MacOS ... if you're really interested in source code, you could download the version typically installed on linux systems here: http://ftp.gnu.org/pub/gnu/findutils/ 不知道macOS附带了find哪个版本...如果您真的对源代码感兴趣,可以在以下位置下载通常安装在linux系统上的版本: http : //ftp.gnu.org/pub/gnu/findutils/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM