What is bin directory in windows

The /bin Directory

/bin is a standard subdirectory of the root directory in Unix-like operating systems that contains the executable (i.e., ready to run) programs that must be available in order to attain minimal functionality for the purposes of booting (i.e., starting) and repairing a system.

The root directory, which is designated by a forward slash ( / ), is the top-level directory in the hierarchy of directories (also referred to as the directory tree) on Unix-like operating systems. That is, it is the directory that contains all other directories and their subdirectories as well as all files on the system.

A directory in a Unix-like operating system is merely a special type of file that contains a list of the names of objects (i.e., files, links and directories) that appear to the user to be in it along with the corresponding inodes for each object. A file is a named collection of related information that appears to the user as a single, contiguous block of data and that is retained in storage (e.g., a hard disk drive or a floppy disk). An inode is a data structure on a filesystem that stores all the information about a filesystem object except its name and its actual data. A data structure is a way of storing data so that it can be used efficiently. A filesystem is the hierarchy of directories that is used to organize files on a computer system.

The full names (also referred to as the absolute pathnames) of all of the subdirectories in the root directory begin with a forward slash, which shows their position in the filesystem hierarchy. In addition to /bin, some of the other standard subdirectories in the root directory include /boot, /dev, /etc, /home, /mnt, /usr, /proc and /var.

Among the contents of /bin are the shells (e.g., bash and csh), ls, grep, tar, kill, echo, ps, cp, mv, rm, cat, gzip, ping, su and the vi text editor. These programs can be used by both the root user (i.e., the administrative user) and ordinary users.

A list of all the programs in /bin can be viewed by using the ls command, which is commonly used to view the contents of directories, i.e.,

/bin is by default in PATH, which is the list of directories that the system searches for the corresponding program when a command is issued. This means that any executable file (i.e., runnable program) in /bin can be run just by entering the file name at the command line and then pressing the ENTER key. The contents of PATH can be seen by using the echo command as follows:

Читайте также:  Windows не удалось отформатировать системный раздел

There are several other directories on Unix-like systems that also contain the string (i.e., sequence of characters) bin in their names, including /sbin and /usr/bin. The former contains additional programs that are used to boot the system as well as administrative and system maintenance programs that are only available to the root user. The latter contains executable programs that are not required for booting or repairing the system.

Created June 5, 2005.
Copyright © 2005 The Linux Information Project. All Rights Reserved.

Что эквивалентно (Linux) bin Directory в Windows?

Хотя все операционные системы имеют некоторые общие черты, вы можете задаться вопросом, есть ли у одного типа операционной системы особая «функция», чем у другого. Имея это в виду, в сегодняшней публикации SuperUser Q&A есть ответы на любопытный вопрос читателя.

Сегодняшняя сессия вопросов и ответов была предоставлена ​​нам благодаря SuperUser — подразделению Stack Exchange, группы веб-сайтов вопросов и ответов, управляемой сообществом.

Фото любезно предоставлено BiblioArchives / LibraryArchives (Flickr).

Вопрос

Читатель SuperUser Тоби Блант хочет знать, есть ли эквивалент для каталога bin (Linux) в Windows:

Есть ли в Windows аналог каталога bin Linux? Если да, то как я могу получить к нему доступ из командной строки?

Что эквивалентно каталогу bin (Linux) в Windows?

Ответ

У CBHacking есть ответ для суперпользователя:

На самом деле в этом нет ничего особенного / bin на Unix / Linux вообще. Это просто место, где по соглашению размещаются исполняемые файлы и сценарии (которые на самом деле не являются двоичными файлами). Он включен в ДОРОЖКА переменная окружения по умолчанию для всех пользователей.

Как говорит Райан (Комментарии один а также два), Каталог Windows System32 в Windows также есть в ДОРОЖКА для всех пользователей Windows (и даже если это не так, загрузчик программ в Windows все равно будет искать там).

Вы можете легко создать свой собственный эквивалент / bin в Windows. Чтобы сделать его общесистемным, поместите его где-нибудь, например, в корень файловой системы (например, C: bin или в уже ограниченном месте, например Windows System32 bin) и добавьте его в ДОРОЖКА переменная окружения для всех пользователей.

Для каждого пользователя создайте каталог в своем профиле (% ПОЛЬЗОВАТЕЛЬСКИЙ ПРОФИЛЬ% bin) и добавьте его в свой аккаунт ДОРОЖКА переменная окружения. Windows объединяет переменные среды с одинаковыми именами, поэтому все на компьютере ДОРОЖКА переменная также добавляется к любому пользователю ДОРОЖКА, но не наоборот.

Конечно, вам нужно будет добавить файлы, скрипты, ярлыки и символические ссылки на ваш / bin каталог себя. Установщики Windows этого не ожидают и не будут автоматически помещать туда файлы, как это обычно делают установщики Linux.

Читайте также:  Создать образ dvd диска mac os

Обязательно прочитайте другие интересные ответы на эту ветку вопросов по ссылке ниже!

Есть что добавить к объяснению? Отключить звук в комментариях. Хотите узнать больше ответов от других технически подкованных пользователей Stack Exchange? Ознакомьтесь с полной веткой обсуждения здесь.

What is the equivalent of the bin directory for Windows?

Is there an equivalent to bin for Windows? If so, how can I access it from the command prompt?

5 Answers 5

There’s nothing actually special about /bin on Unix/Linux at all. It’s just the location where executable files (including scripts, which aren’t actually binary files) are placed by convention, and it is included in the PATH environment variable by default for all users. As Ryan says, the \Windows\System32 directory on Windows is also in PATH for all Windows users (and, even if it isn’t, Windows’ program loader 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 (as in 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 the per-user and system-wide PATH environment variables, so anything in the machine PATH variable is also added to any user’s PATH , but not the other way around.

Of course, you’ll have to add files / scripts / shortcuts / symlinks to your bin directory yourself. Windows installers don’t expect such a thing, and won’t put files there automatically the way that Linux installers will usually do.

How do I put PostgreSQL /bin directory on my path in Windows?

I’ve got a fairly simple question I guess. I’m working on a Ruby on Rails app. I’m trying to switch to PostgreSQL thanks to Heroku.

In my database.yml file it states:

My question is how do I put PostgreSQL’s /bin directory on my path? Exactly which file do I modify and how?

I imagine this is my issue since when I run the «rails db» command i get:

«Couldn’t find database client: psql,psql.exe. Check your $PATH and try again.»

Thanks everyone! Robin.

4 Answers 4

Append the directory to system PATH (not user PATH ) by Environment Variables, using a semicolon to separate it from the previous entry.

You can find it from control pannel -> system -> Advanced -> Environment Variables

Ran into the same issue and tried the solution mentioned here

Читайте также:  Windows file shadow copy

Should do the trick.

You need to install Postgres first then add the path to system properties > environment variables > in system variables section you will see PATH variable

This is my preferred way of adding a new location to the PATH environment variable (on modern Red-Hat-based systems):

  • PATH is a colon : separated list of directories that are search, in order, for a called program.
  • Profile configurations under /etc are persistent for all users (but require the active shell to source them to take effect).
  • The version number is tacked on to the PostgreSQL directory when it is installed from their repository.

Which folder is recycle bin in on Win7? How to check files there?

I was using another account before. Let me call it account A. And I deleted a lot of files to the Recycle Bin at that time. But before I removed account A I forgot to empty the Recycle Bin.

My question is, are my files still there? I’ve searched and found that the Recycle Bin may live in $Recycle.Bin , but I can’t open files there so I can’t know what they are. Any help how to open deleted files or how to delete them permanently?

3 Answers 3

Accordind to this site

Recycle Bin is located in a hidden directory named \$Recycle.Bin\%SID%, where %SID% is the SID of the user that performed the deletion.

You will need to know the SID of the account that was removed, or you can browse through the available folders to determine which one you need. Since this is a hidden folder you won’t see anything in it by default.

To see the folders

  • Open Explorer
  • In the location bar enter C:\$Recycle.Bin and press Enter
  • Click Organize
  • Select Folder and Search Options
  • Select the View tab
  • Select Show hidden files, folders, and drives
  • Untick Hide protected operating system files
  • Click OK

You can also do this from the command line but the file names are encoded as explained in the linked article. When I tried this I noticed I could see more files than were visible in Explorer.

  • Click Start
  • Type cmd in the seach box and press Enter
  • Type cd c:\$recycle.bin and press Enter
  • Type dir /ah and press Enter to see all the available folders.
  • Type dir *.* /s and press Enter to see all the files in all the available folders (with their encoded names).

In my case I found two folders that contained files. One was my recycle bin. The other was from another user and contained files that I could not see in Explorer. I could however copy these files elsewhere, open them, etc.

Оцените статью