linux bin目录_Windows中(Linux)bin目录的等效项是什么?
linux bin目录
While all operating systems have some things in common, you may find yourself wondering if one type of operating system has a specific ‘feature’ that another one does. With that in mind, today’s SuperUser Q&A post has the answers to a curious reader’s question.
尽管所有操作系统都有一些共同点,但您可能会想知道一种操作系统是否具有另一种特定的“功能”。 考虑到这一点,今天的SuperUser Q&A帖子回答了一个好奇的读者的问题。
Today’s Question & Answer session comes to us courtesy of SuperUser—a subdivision of Stack Exchange, a community-driven grouping of Q&A web sites.
今天的“问答”环节由SuperUser提供,它是Stack Exchange的一个分支,该社区是由社区驱动的Q&A网站分组。
Photo courtesy of BiblioArchives/LibraryArchives (Flickr).
图片由BiblioArchives / LibraryArchives(Flickr)提供。
问题 (The Question)
SuperUser reader Toby Blunt wants to know if there is an equivalent for the (Linux) bin directory in Windows:
超级用户阅读器Toby Blunt想知道Windows中(Linux)bin目录是否存在等效项:
Is there an equivalent for Linux’s bin directory in Windows? If so, how can I access it from the command prompt?
Windows中Linux的bin目录是否等效? 如果是这样,如何从命令提示符下访问它?
What is the equivalent of the (Linux) bin directory in Windows?
Windows中(Linux)bin目录的等效项是什么?
答案 (The Answer)
SuperUser contributor CBHacking has the answer for us:
超级用户贡献者CBHacking为我们提供了答案:
There is actually nothing special about /bin on Unix/Linux at all. It is just the location where executable files and scripts (which are not actually binary files) are placed by convention. It is included in the PATH environment variable by default for all users.
实际上,在Unix / Linux上,关于/ bin并没有什么特别的。 它只是按照惯例放置可执行文件和脚本(实际上不是二进制文件)的位置。 默认情况下,所有用户都将其包含在PATH环境变量中。
As Ryan says (comments one and two), the \Windows\System32 directory on Windows is also in PATH for all Windows users (and, even if it is not, the program loader in Windows will search there anyhow).
正如Ryan所说(评论一和二), Windows上的\ Windows \ System32目录也位于所有Windows用户的PATH中(即使不是,Windows中的程序加载器也将在其中搜索)。
You can easily create your own equivalent of /bin on Windows. To make it system-wide, place it somewhere like the root of the file system (such as C:\bin or under an already-restricted location like \Windows\System32\bin), and add it to the PATH environment variable for all users.
您可以在Windows上轻松创建自己的/ bin等效项。 要使其在系统范围内,请将其放置在文件系统根目录之类的位置(例如C:\ bin或在已经受限制的位置下,例如\ Windows \ System32 \ bin ),然后将其添加到所有环境的PATH环境变量中。用户。
For a per-user location, create the directory in your own profile (%USERPROFILE%\bin) and add it to your account’s PATH environment variable. Windows combines environment variables with the same name, so anything in the machine PATH variable is also added to any user’s PATH, but not the other way around.
对于每个用户的位置,请在您自己的配置文件( %USERPROFILE%\ bin )中创建目录,并将其添加到您帐户的PATH环境变量中。 Windows将具有相同名称的环境变量组合在一起,因此计算机PATH变量中的所有内容也将添加到任何用户的PATH中,但反之则没有。
Of course, you will have to add files, scripts, shortcuts, and symlinks to your /bin directory yourself. Windows installers do not expect such a thing and will not put files there automatically the way that Linux installers usually do.
当然,您必须自己将文件,脚本,快捷方式和符号链接添加到/ bin目录中。 Windows安装程序不希望出现这种情况,并且不会像Linux安装程序通常那样自动将文件放置在此处。
Make sure to read through the other interesting answers for this question thread via the link below!
请确保通过下面的链接通读该问题主题的其他有趣答案!
Have something to add to the explanation? Sound off in the comments. Want to read more answers from other tech-savvy Stack Exchange users? Check out the full discussion thread here.
有什么补充说明吗? 在评论中听起来不错。 是否想从其他精通Stack Exchange的用户那里获得更多答案? 在此处查看完整的讨论线程。
翻译自: https://www.howtogeek.com/231220/what-is-the-equivalent-of-the-linux-bin-directory-in-windows/
linux bin目录