什麼是windows中(linux)bin目錄的等價物?

雖然所有作業系統都有一些共同點,但您可能會發現自己在想,一種作業系統是否有另一種作業系統所具有的特定“功能”。有鑑於此,今天的超級使用者問答帖子回答了一位好奇的讀者的問題。...

什麼是windows中(linux)bin目錄的等價物?

雖然所有作業系統都有一些共同點,但您可能會發現自己在想,一種作業系統是否有另一種作業系統所具有的特定“功能”。有鑑於此,今天的超級使用者問答帖子回答了一位好奇的讀者的問題。

今天的問答環節是由SuperUser提供的,SuperUser是Stack Exchange的一個分支,是一個由社群驅動的問答網站分組。

圖片由BiblioArchives/LibraryArchives(Flickr)提供。

問題

超級使用者讀者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目錄的等價物?

答案

超級使用者駭客幫我們找到了答案:

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.

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).

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.

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.

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.

請務必透過下面的連結閱讀此問題線索的其他有趣答案!


有什麼要補充的解釋嗎?在評論中發出聲音。想從其他精通技術的Stack Exchange使用者那裡瞭解更多答案嗎?在這裡檢視完整的討論主題。

  • 發表於 2021-04-10 04:59
  • 閱讀 ( 38 )
  • 分類:網際網路

你可能感興趣的文章

物件(object)和補足(complement)的區別

...賓語也可以是補語的一部分。 目錄 1. 概述和主要區別 2. 什麼是物件 3. 什麼是補碼 4. 賓語與補語的關係 5. 並列比較-表格形式的物件與補足 6. 摘要 什麼是一個物體(an object)? 賓語是動詞後面的名詞或名詞短語。它通常指動詞所...

  • 發佈於 2020-10-21 21:19
  • 閲讀 ( 72 )

為linux愛好者提供8個適合每個預算的禮品創意

...,你可能會有點緊張,決定在你的生活中給Linux愛好者買什麼。 ...

  • 發佈於 2021-03-12 03:29
  • 閲讀 ( 51 )

mono是什麼?它如何幫助windows切換到linux?

... 什麼是單聲道(mono)? ...

  • 發佈於 2021-03-12 18:14
  • 閲讀 ( 53 )

什麼是shell指令碼,為什麼要使用它

... 既然您已經知道了shell指令碼是什麼以及它們的許多優點,您不想在任務中使用它們嗎?您在使用它們時遇到了哪些問題?請在下面的評論中告訴我們。 ...

  • 發佈於 2021-03-13 04:53
  • 閲讀 ( 54 )

如何在linux和macos上將手冊頁縮短為可讀的解釋

...試時可能會看到一個錯誤,上面寫著“沒有這樣的檔案或目錄”。 ...

  • 發佈於 2021-03-14 01:21
  • 閲讀 ( 54 )

windows與linux:以下是它們的共同點

... 下面是一些漂亮的例子,說明任務排程器可以做什麼,以及Windows10中新的任務排程器功能。 ...

  • 發佈於 2021-03-14 16:05
  • 閲讀 ( 56 )

如何在linux中使用ls命令

...供與每個條目相關聯的數值。很明顯,你不知道這個值是什麼意思。因此,要以可讀的方式列出檔案及其大小,請在命令中使用-lh標誌。 ...

  • 發佈於 2021-03-26 18:01
  • 閲讀 ( 56 )

linux中的程序是什麼?

... 什麼是過程(a process)? ...

  • 發佈於 2021-03-27 02:21
  • 閲讀 ( 60 )

關於linux中bash for loops的所有知識

...Mac系統管理員通常都熟悉透過終端編寫指令碼,但即使是Windows使用者也可以使用Windows子系統for Linux來進行操作。 ...

  • 發佈於 2021-03-29 06:22
  • 閲讀 ( 59 )

如何使用受限shell來限制linux使用者可以做什麼

受限的shell限制了使用者帳戶在Linux上可以做什麼。受限使用者不能更改其目錄,您可以控制他們可以訪問哪些命令。下面介紹如何在Linux上設定受限shell。 受限炮彈 受限shell不是另一個shell。這是標準外殼的另一種模式。Bash...

  • 發佈於 2021-03-31 10:57
  • 閲讀 ( 56 )
Ci30818915777
Ci30818915777

0 篇文章

作家榜

  1. admin 0 文章
  2. 孫小欽 0 文章
  3. JVhby0 0 文章
  4. fvpvzrr 0 文章
  5. 0sus8kksc 0 文章
  6. zsfn1903 0 文章
  7. w91395898 0 文章
  8. SuperQueen123 0 文章

相關推薦